LinuxカーネルにあるBUILD_BUG_ONマクロ。名前からやりたいことは十分に分かるんだけど、これはどういう仕組みなのかというところ。 使っている例としてarch/x86/kernel/head64.cにあるx86_64_start_kernel()を見てみるとこんな感じ。 140 asmlinkage void __init x86_64_start_kernel(char * real_mode_data) 141 { 142 int i; 143 144 /* 145 * Build-time sanity checks on the kernel image and module 146 * area mappings. (these are purely build-time and produce no code) 147 */ 148 BUILD_BUG_ON(MODU
News (Oct 27, 2004) TCCBOOT is slashdotted. Introduction TCCBOOT is a boot loader able to compile and boot a Linux kernel directly from its source code. TCCBOOT is only 138 KB big (uncompressed code) and it can compile and run a typical Linux kernel in less than 15 seconds on a 2.4 GHz Pentium 4. TCCBOOT is based on the TinyCC compiler, assembler and linker. TinyCC is an experiment to produce a ve
説明† パス: linux-4.4.1/include/linux/kernel.h ポインタが指す構造体のメンバ、それを含む構造体へのポインタを返す。 例えば、 struct example { int mem_a; char mem_b; }; struct example hoge; という構造体があったとする。 int *mem_ptr = &hoge.mem_a; 上記のような、構造体のメンバへのポインタ mem_ptr しか 分からない状態から hoge へのポインタを得たいときに container_of を 使う。 struct example *ptr = container_of(mem_ptr, struct example, mem_a); すると ptr が指す先(hoge.mem_a)を含む構造体への ポインタ(&hoge)が得られる。 ↑ 引数† ptr 構造
Linux Kernel: __initマクロ、__exitマクロの役割(メモリの有効利用) by nao · 公開済み 2019年4月29日 · 更新済み 2020年12月25日 __initマクロ、__exitマクロが使われるケース 一般的に、__initマクロはKernelモジュールの初期化時、__exitマクロはKernelモジュールの終了時に付与します。以下の例では、初期化関数がdebimate_init()、終了関数がdebimate_exit()で、それぞれにマクロを付与しています。 static int __init debimate_init(void) { int result = 0; struct device *debimate_dev = NULL; pr_info(KERN_INFO "START: %s\n", __func__); /* メジャー番号の動的
jemalloc is a general-purpose scalable concurrent malloc(3) implementation. There are several divergent versions of jemalloc in active use, including: FreeBSD's default system allocator (malloc.c, manual page). This was the first public use of jemalloc, and it is still author-maintained. NetBSD's default system allocator (jemalloc.c). Mozilla Firefox's allocator (source code), specifically for Mi
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く