diff --git a/include/ucore/slot_allocator.h b/include/ucore/slot_allocator.h index 55d4eb9..417df05 100644 --- a/include/ucore/slot_allocator.h +++ b/include/ucore/slot_allocator.h @@ -4,7 +4,7 @@ #include #include -// 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; struct UCSlot { UCSlot *next; @@ -66,6 +66,9 @@ static inline void *uc_slot_alloc(UCSlotArena *arena) if (slot != NULL) { arena->free_list = slot->next; arena->used_slots++; +#ifdef DEBUG + memset(slot, 0xCB, arena->slot_size); +#endif } return slot;