Cleanup: Unify type naming and Cold Iface architecture

Refactoring:
- Type naming: Rename small_page_v4 → SmallPageMeta, small_class_heap_v4 → SmallClassHeap, small_heap_ctx_v4 → SmallHeapCtx
- Keep backward compatibility aliases for existing code
- SmallSegment struct unified, clean forward declarations
- Cold Iface: Remove vtable (SmallColdIfaceV4 struct) in favor of direct function calls
- Simplify refill_page/retire_page to direct calls, not callbacks
- smallobject_hotbox_v4.c: Update to call small_cold_v4_* functions directly

Documentation:
- Add docs/analysis/ENV_CLEANUP_CANDIDATES.md
- Categorize ENVs: KEEP (production), RESEARCH (opt-in), DELETE (obsolete)
- v2 code: Keep as research infrastructure (complete, safe, gated)
- v4 code: Research scaffold for future mid-level allocator

Build:
- ビルド成功(警告のみ)
- Backward compatible, all existing code still works

🤖 Generated with Claude Code

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
Moe Charm (CI)
2025-12-10 23:30:32 +09:00
parent 52c65da783
commit e3e4cab833
5 changed files with 197 additions and 80 deletions

View File

@ -4,23 +4,29 @@
#include <stdint.h>
// Forward declaration for SmallPageMeta
struct small_page_v4;
// Forward declaration
struct SmallPageMeta;
// ============================================================================
// SmallSegment: class_idx ごとに小さな segment を管理
// 基本構造: base, page metadata array
typedef struct small_segment_v4 {
// ============================================================================
typedef struct SmallSegment {
uintptr_t base; // Segment base address
uint32_t num_pages; // Number of pages in segment
uint32_t owner_tid; // Thread ID that owns this segment
uint32_t magic; // Magic number for validation
// Page metadata array (flexible, actual size depends on SMALL_PAGE_SIZE / SMALL_SEGMENT_SIZE)
// struct small_page_v4* page_meta[];
} small_segment_v4;
// struct SmallPageMeta* page_meta[];
} SmallSegment;
// API: Segment 取得・解放
small_segment_v4* smallsegment_v4_acquire(int class_idx);
void smallsegment_v4_release_if_empty(small_segment_v4* seg, void* page, int class_idx);
// Backward compatibility alias
typedef SmallSegment small_segment_v4;
// API: ページメタデータの取得
struct small_page_v4* smallsegment_v4_page_meta_of(small_segment_v4* seg, void* ptr);
// ============================================================================
// API: Segment Management
// ============================================================================
SmallSegment* smallsegment_v4_acquire(int class_idx);
void smallsegment_v4_release_if_empty(SmallSegment* seg, void* page, int class_idx);
struct SmallPageMeta* smallsegment_v4_page_meta_of(SmallSegment* seg, void* ptr);