// smallobject_hotbox_v5_box.h - SmallObject HotBox v5 型定義(Phase v5-0) // // この段階では型とインターフェース定義のみ。挙動は変わらない。 #ifndef HAKMEM_SMALLOBJECT_HOTBOX_V5_BOX_H #define HAKMEM_SMALLOBJECT_HOTBOX_V5_BOX_H #include #define NUM_SMALL_CLASSES_V5 8 // C0–C7 // SmallPageMetaV5: v5 ページメタデータ typedef struct SmallPageMetaV5 { void* free_list; // フリーリスト先頭 uint16_t used; // 使用中ブロック数 uint16_t capacity; // このページの総容量 uint8_t class_idx; // size class index uint8_t flags; // reserved uint16_t page_idx; // segment 内でのページインデックス void* segment; // SmallSegmentV5* への backpointer } SmallPageMetaV5; // SmallClassHeapV5: サイズクラス毎のホットヒープ状態 typedef struct SmallClassHeapV5 { SmallPageMetaV5* current; // 現在のページ(alloc 中) SmallPageMetaV5* partial_head; // partial ページリスト SmallPageMetaV5* full_head; // full ページリスト } SmallClassHeapV5; // SmallHeapCtxV5: per-thread ホットヒープコンテキスト typedef struct SmallHeapCtxV5 { SmallClassHeapV5 cls[NUM_SMALL_CLASSES_V5]; } SmallHeapCtxV5; // API SmallHeapCtxV5* small_heap_ctx_v5(void); // Fast path(将来実装) void* small_alloc_fast_v5(size_t size, uint32_t class_idx); void small_free_fast_v5(void* ptr, uint32_t class_idx); #endif // HAKMEM_SMALLOBJECT_HOTBOX_V5_BOX_H