2025-12-11 03:25:37 +09:00
|
|
|
|
// smallobject_hotbox_v5.c - SmallObject HotBox v5 実装 stub(Phase v5-0/v5-1)
|
2025-12-11 03:09:57 +09:00
|
|
|
|
//
|
2025-12-11 03:25:37 +09:00
|
|
|
|
// v5-1: C6-only route stub(v1/pool fallback via malloc_tiny_fast.h fallthrough)
|
|
|
|
|
|
// 実装部分は v5-2 以降で追加される
|
2025-12-11 03:09:57 +09:00
|
|
|
|
|
|
|
|
|
|
#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;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-11 03:25:37 +09:00
|
|
|
|
// 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) {
|
2025-12-11 03:09:57 +09:00
|
|
|
|
(void)size;
|
2025-12-11 03:25:37 +09:00
|
|
|
|
(void)ctx;
|
2025-12-11 03:09:57 +09:00
|
|
|
|
(void)class_idx;
|
2025-12-11 03:25:37 +09:00
|
|
|
|
// v5-1: C6-only route stub - return NULL to fallthrough to v1/pool
|
|
|
|
|
|
// actual hot-path implementation in v5-2
|
2025-12-11 03:09:57 +09:00
|
|
|
|
return NULL;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2025-12-11 03:25:37 +09:00
|
|
|
|
// 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) {
|
2025-12-11 03:09:57 +09:00
|
|
|
|
(void)ptr;
|
2025-12-11 03:25:37 +09:00
|
|
|
|
(void)ctx;
|
2025-12-11 03:09:57 +09:00
|
|
|
|
(void)class_idx;
|
2025-12-11 03:25:37 +09:00
|
|
|
|
// v5-1: C6-only route stub - no-op (fallthrough handled by caller)
|
|
|
|
|
|
// actual hot-path implementation in v5-2
|
2025-12-11 03:09:57 +09:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 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
|
|
|
|
|
|
}
|