Files
hakmem/core/box/tiny_c7_ultra_box.h
2025-12-10 22:19:32 +09:00

26 lines
1.0 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.

// 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 pointsUF-1 は v3 C7 に委譲)
void* tiny_c7_ultra_alloc(size_t size);
void tiny_c7_ultra_free(void* ptr);