fix: guard Tiny FG misclass and add fg_tiny_gate box
This commit is contained in:
@ -239,6 +239,8 @@ inline void* hak_alloc_at(size_t size, hak_callsite_t site) {
|
||||
if (hdr->magic != HAKMEM_MAGIC) { fprintf(stderr, "[hakmem] ERROR: Invalid magic in allocated header!\n"); return ptr; }
|
||||
hdr->alloc_site = site_id;
|
||||
hdr->class_bytes = (size >= threshold) ? threshold : 0;
|
||||
// Guard byte for FrontGate V2: force ptr[-1] away from 0xA?/0xB? to avoid Tiny misclass
|
||||
((uint8_t*)hdr)[HEADER_SIZE - 1] = HAKMEM_FG_GUARD_BYTE;
|
||||
|
||||
#if HAKMEM_DEBUG_TIMING
|
||||
HKM_TIME_END(HKM_CAT_HAK_ALLOC, t0);
|
||||
|
||||
Reference in New Issue
Block a user