This commit is contained in:
Nils O. Selåsdal
2026-04-21 22:53:07 +02:00
parent 36457f775f
commit d1a45cf8e0
+4 -1
View File
@@ -4,7 +4,7 @@
#include <stdint.h> #include <stdint.h>
#include <assert.h> #include <assert.h>
// Repurpose free memory to eep a linked list of free slots //Free memory is reused to build a linked list of slots
typedef struct UCSlot UCSlot; typedef struct UCSlot UCSlot;
struct UCSlot { struct UCSlot {
UCSlot *next; UCSlot *next;
@@ -66,6 +66,9 @@ static inline void *uc_slot_alloc(UCSlotArena *arena)
if (slot != NULL) { if (slot != NULL) {
arena->free_list = slot->next; arena->free_list = slot->next;
arena->used_slots++; arena->used_slots++;
#ifdef DEBUG
memset(slot, 0xCB, arena->slot_size);
#endif
} }
return slot; return slot;