- tiny_route_env_box.h: TINY_ROUTE_SMALL_HEAP_V5 enum 追加、route snapshot で C6→v5 分岐 - malloc_tiny_fast.h: alloc/free switch に v5 case 追加(v1/pool fallback) - smallobject_hotbox_v5.c: stub 実装(alloc は NULL 返却、free は no-op) - smallobject_hotbox_v5_box.h: 関数 signature に ctx パラメータ追加 - Makefile: core/smallobject_hotbox_v5.o をリンクリストに追加 - ENV_PROFILE_PRESETS.md: v5-1 プリセット追記 - CURRENT_TASK.md: Phase v5-1 完了記録 **特性**: - ENV: HAKMEM_SMALL_HEAP_V5_ENABLED=1 / HAKMEM_SMALL_HEAP_V5_CLASSES=0x40 で opt-in - テスト結果: C6-heavy (v5 OFF 15.5M → v5 ON 16.4M ops/s, 正常), Mixed 47.2M ops/s, SEGV/assert なし - 挙動は v1/pool fallback と同じ(実装は v5-2) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
80 lines
2.2 KiB
C
80 lines
2.2 KiB
C
// smallobject_hotbox_v5.c - SmallObject HotBox v5 実装 stub(Phase v5-0/v5-1)
|
||
//
|
||
// v5-1: C6-only route stub(v1/pool fallback via malloc_tiny_fast.h fallthrough)
|
||
// 実装部分は v5-2 以降で追加される
|
||
|
||
#include <stdlib.h>
|
||
#include <stdbool.h>
|
||
#include "box/smallsegment_v5_box.h"
|
||
#include "box/smallobject_hotbox_v5_box.h"
|
||
#include "box/smallobject_cold_iface_v5.h"
|
||
#include "box/smallobject_v5_env_box.h"
|
||
|
||
// TLS context
|
||
static __thread SmallHeapCtxV5 g_small_heap_ctx_v5;
|
||
|
||
SmallHeapCtxV5* small_heap_ctx_v5(void) {
|
||
return &g_small_heap_ctx_v5;
|
||
}
|
||
|
||
// Phase v5-1: Fast alloc(C6-only route stub, fallthrough to v1/pool)
|
||
// malloc_tiny_fast.h の route switch で NULL が返されると fallthrough する設計
|
||
void* small_alloc_fast_v5(size_t size, uint32_t class_idx, SmallHeapCtxV5* ctx) {
|
||
(void)size;
|
||
(void)ctx;
|
||
(void)class_idx;
|
||
// v5-1: C6-only route stub - return NULL to fallthrough to v1/pool
|
||
// actual hot-path implementation in v5-2
|
||
return NULL;
|
||
}
|
||
|
||
// Phase v5-1: Fast free(C6-only route stub, fallthrough to v1/pool)
|
||
// malloc_tiny_fast.h で route switch 内で呼ばれ、値を返さない
|
||
void small_free_fast_v5(void* ptr, uint32_t class_idx, SmallHeapCtxV5* ctx) {
|
||
(void)ptr;
|
||
(void)ctx;
|
||
(void)class_idx;
|
||
// v5-1: C6-only route stub - no-op (fallthrough handled by caller)
|
||
// actual hot-path implementation in v5-2
|
||
}
|
||
|
||
// Segment stub(v5-2 で実装)
|
||
SmallSegmentV5* small_segment_v5_acquire(void) {
|
||
return NULL; // stub
|
||
}
|
||
|
||
void small_segment_v5_release(SmallSegmentV5* seg) {
|
||
(void)seg;
|
||
// stub
|
||
}
|
||
|
||
SmallPageMetaV5* small_segment_v5_page_meta_of(void* ptr) {
|
||
(void)ptr;
|
||
return NULL; // stub
|
||
}
|
||
|
||
// ColdIface stub(v5-2 で実装)
|
||
SmallPageMetaV5* small_cold_v5_refill_page(SmallHeapCtxV5* ctx, uint32_t class_idx) {
|
||
(void)ctx;
|
||
(void)class_idx;
|
||
return NULL; // stub
|
||
}
|
||
|
||
void small_cold_v5_retire_page(SmallHeapCtxV5* ctx, SmallPageMetaV5* page) {
|
||
(void)ctx;
|
||
(void)page;
|
||
// stub
|
||
}
|
||
|
||
bool small_cold_v5_remote_push(SmallPageMetaV5* page, void* ptr, uint32_t tid) {
|
||
(void)page;
|
||
(void)ptr;
|
||
(void)tid;
|
||
return false; // stub
|
||
}
|
||
|
||
void small_cold_v5_remote_drain(SmallHeapCtxV5* ctx) {
|
||
(void)ctx;
|
||
// stub
|
||
}
|