Files
hakmem/core/smallobject_hotbox_v5.c

80 lines
2.2 KiB
C
Raw Normal View History

// 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
}