Boxify superslab registry, add bench profile, and document C7 hotpath experiments

This commit is contained in:
Moe Charm (CI)
2025-12-07 03:12:27 +09:00
parent 18faa6a1c4
commit fda6cd2e67
71 changed files with 2052 additions and 286 deletions

View File

@ -12,6 +12,7 @@
// Cold/maintenance path - not performance critical.
#include "tiny_tls_guard.h"
#include "box/ss_slab_meta_box.h" // Phase 3d-A: SlabMeta Box boundary
#include "hakmem_super_registry.h"
// Phase 12: Helper to derive a representative class index for a SuperSlab
// from per-slab metadata (all slabs are empty when used in trim).
@ -96,8 +97,11 @@ void hak_tiny_trim(void) {
}
// Walk the registry and collect empty SuperSlabs by class
for (int i = 0; i < SUPER_REG_SIZE; i++) {
SuperRegEntry* e = &g_super_reg[i];
SuperRegEntry* reg = super_reg_entries();
int reg_cap = super_reg_effective_size();
if (!reg || reg_cap <= 0) return;
for (int i = 0; i < reg_cap; i++) {
SuperRegEntry* e = &reg[i];
uintptr_t base = atomic_load_explicit((_Atomic uintptr_t*)&e->base, memory_order_acquire);
if (base == 0) continue;
SuperSlab* ss = e->ss;