For about five years I've been trying to implement a fully conforming C preprocessor for the front end of the CScout refactoring browser. I've found this to be a fiendishly difficult task. Although what I have written can correctly process million-line real-life projects, every once in a while I come across a construct that confuses my implementation. While searching the web for explanations of so
説明† パス: 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__); /* メジャー番号の動的
3.7.2 Common Predefined Macros ¶ The common predefined macros are GNU C extensions. They are available with the same meanings regardless of the machine or operating system on which you are using GNU C or GNU Fortran. Their names all start with double underscores. __COUNTER__ This macro expands to sequential integral values starting from 0. In conjunction with the ## operator, this provides a conve
#include "Cello.h" int main(int argc, char** argv) { /* Stack objects are created using "$" */ var i0 = $(Int, 5); var i1 = $(Int, 3); var i2 = $(Int, 4); /* Heap objects are created using "new" */ var items = new(Array, Int, i0, i1, i2); /* Collections can be looped over */ foreach (item in items) { print("Object %$ is of type %$\n", item, type_of(item)); } /* Heap objects destructed via Garbage
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く