namespace { static const swift::MetadataSections *registered = nullptr; void record(const swift::MetadataSections *sections) { if (registered == nullptr) { registered = sections; sections->next = sections->prev = sections; } else { registered->prev->next = sections; sections->next = registered; sections->prev = registered->prev; registered->prev = sections; } } }
これでリンクリストに追加してた。 (edited)