Files
hakmem/core/smallobject_hotbox_v5.c
Moe Charm (CI) 9c24bebf08 Phase v5-1: SmallObject v5 C6-only route stub 接続
- 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>
2025-12-11 03:25:37 +09:00

80 lines
2.2 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// smallobject_hotbox_v5.c - SmallObject HotBox v5 実装 stubPhase v5-0/v5-1
//
// v5-1: C6-only route stubv1/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 allocC6-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 freeC6-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 stubv5-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 stubv5-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
}