Add extra ASSERTs to PAlloc_AllocPage

This commit is contained in:
Ali Mashtizadeh 2023-09-03 14:56:44 -04:00
parent ed9a15e97d
commit 3e5eeacf09

View File

@ -171,13 +171,16 @@ PAlloc_AllocPage()
Spinlock_Lock(&pallocLock);
pg = LIST_FIRST(&freeList);
ASSERT(pg != NULL);
LIST_REMOVE(pg, entries);
ASSERT(pg->magic == FREEPAGE_MAGIC_FREE);
info = PAllocGetInfo(pg);
ASSERT(info != NULL);
ASSERT(info->refCount == 0);
info->refCount++;
ASSERT(pg->magic == FREEPAGE_MAGIC_FREE);
pg->magic = FREEPAGE_MAGIC_INUSE;
freePages--;