Fix debug build after clean reset
This commit is contained in:
@ -122,14 +122,17 @@ static inline int tiny_remote_queue_contains_guard(SuperSlab* ss, int slab_idx,
|
||||
void hak_tiny_free_with_slab(void* ptr, TinySlab* slab) {
|
||||
// Phase 7.6: slab == NULL means SuperSlab mode (Magazine integration)
|
||||
SuperSlab* ss = NULL;
|
||||
TinySlabMeta* meta = NULL;
|
||||
int class_idx = -1;
|
||||
int slab_idx = -1;
|
||||
if (!slab) {
|
||||
// SuperSlab path: Get class_idx from SuperSlab
|
||||
ss = hak_super_lookup(ptr);
|
||||
if (!ss || ss->magic != SUPERSLAB_MAGIC) return;
|
||||
// Derive class_idx from per-slab metadata instead of ss->size_class
|
||||
int class_idx = -1;
|
||||
class_idx = -1;
|
||||
// void* base = ptr_user_to_base_blind(ptr); // FIX: Use ptr (USER) directly
|
||||
int slab_idx = slab_index_for(ss, ptr); // FIX: slab_index_for works better with ptr (USER) for C0/C7
|
||||
slab_idx = slab_index_for(ss, ptr); // FIX: slab_index_for works better with ptr (USER) for C0/C7
|
||||
if (slab_idx >= 0 && slab_idx < ss_slabs_capacity(ss)) {
|
||||
TinySlabMeta* meta_probe = &ss->slabs[slab_idx];
|
||||
if (meta_probe->class_idx < TINY_NUM_CLASSES) {
|
||||
@ -166,7 +169,7 @@ void hak_tiny_free_with_slab(void* ptr, TinySlab* slab) {
|
||||
tiny_debug_ring_record(TINY_RING_EVENT_SUPERSLAB_ADOPT_FAIL, (uint16_t)0xFEu, ss, (uintptr_t)slab_idx);
|
||||
return;
|
||||
}
|
||||
TinySlabMeta* meta = &ss->slabs[slab_idx];
|
||||
meta = &ss->slabs[slab_idx];
|
||||
if (__builtin_expect(g_tiny_safe_free, 0)) {
|
||||
size_t blk = g_tiny_class_sizes[class_idx];
|
||||
uint8_t* slab_base = tiny_slab_base_for(ss, slab_idx);
|
||||
|
||||
Reference in New Issue
Block a user