Files
hakmem/core/smallobject_hotbox_v5.c
Moe Charm (CI) 83d4096fbc Phase v5-0: SmallObject v5 の設計・型/IF/ENV スケルトン追加
設計ドキュメント:
- docs/analysis/SMALLOBJECT_V5_DESIGN.md: v5 アーキテクチャ全体設計

新規ファイル (v5 スケルトン):
- core/box/smallobject_hotbox_v5_box.h: HotBox v5 型定義
- core/box/smallsegment_v5_box.h: Segment v5 型定義
- core/box/smallobject_cold_iface_v5.h: ColdIface v5 IF宣言
- core/box/smallobject_v5_env_box.h: ENV ゲート
- core/smallobject_hotbox_v5.c: 実装 stub (完全 fallback)

特徴:
 型とインターフェースのみ定義(v5-0 は機能なし)
 ENV デフォルト OFF(HAKMEM_SMALL_HEAP_V5_ENABLED=0)
 挙動完全不変(Mixed/C6 benchmark 確認済み)
 v4 との区別を明確化 (*_v5 suffix)
 v5-1 (stub) → v5-2 (本実装) → v5-3 (Mixed) への段階実装準備完了

フェーズ:
- v5-0: 型定義のみ(現在)
- v5-1: C6-only stub route 追加
- v5-2: Segment/HotBox 本実装 (C6-only bench A/B)
- v5-3: Mixed での段階昇格 (C6 → C5 → ...)

目標性能: Mixed 16–1024B で 50–60M ops/s (mimalloc の 5割)

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2025-12-11 03:09:57 +09:00

75 lines
1.8 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
//
// この段階では完全な fallback stub。v5 route は呼ばれないENV default OFF
#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-0: Fast allocstub
void* small_alloc_fast_v5(size_t size, uint32_t class_idx) {
(void)size;
(void)class_idx;
// v5-0: completely disabled, fallback to existing path
// actual implementation in v5-2
return NULL;
}
// Phase v5-0: Fast freestub
void small_free_fast_v5(void* ptr, uint32_t class_idx) {
(void)ptr;
(void)class_idx;
// v5-0: no-op
// actual 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
}