Add C7 ULTRA segment skeleton and TLS freelist
This commit is contained in:
25
core/box/tiny_c7_ultra_box.h
Normal file
25
core/box/tiny_c7_ultra_box.h
Normal file
@ -0,0 +1,25 @@
|
||||
// tiny_c7_ultra_box.h - C7 ULTRA TLS box (UF-2: TLS freelist, coldはv3を利用)
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "tiny_c7_ultra_segment_box.h"
|
||||
|
||||
// Hot box: per-thread TLS context (UF-1 ではフィールドは未使用だが将来の ULTRA 用に定義)
|
||||
typedef struct tiny_c7_ultra_tls_t {
|
||||
void* page_base; // ULTRA 専用 C7 ページ基底
|
||||
size_t block_size; // C7 ブロックサイズ
|
||||
uint32_t capacity; // ページ内スロット数
|
||||
uint32_t used; // 現在使用中スロット
|
||||
void* freelist; // ULTRA 用 freelist 先頭
|
||||
uint32_t page_idx; // セグメント内ページ index
|
||||
tiny_c7_ultra_segment_t* seg; // 所有セグメント
|
||||
tiny_c7_ultra_page_meta_t* page_meta; // 現在のページメタ
|
||||
} tiny_c7_ultra_tls_t;
|
||||
|
||||
// TLS accessor
|
||||
tiny_c7_ultra_tls_t* tiny_c7_ultra_tls_get(void);
|
||||
|
||||
// ULTRA alloc/free entry points(UF-1 は v3 C7 に委譲)
|
||||
void* tiny_c7_ultra_alloc(size_t size);
|
||||
void tiny_c7_ultra_free(void* ptr);
|
||||
Reference in New Issue
Block a user