Add extra ASSERTs to PAlloc_AllocPage
This commit is contained in:
parent
ed9a15e97d
commit
3e5eeacf09
@ -171,13 +171,16 @@ PAlloc_AllocPage()
|
|||||||
|
|
||||||
Spinlock_Lock(&pallocLock);
|
Spinlock_Lock(&pallocLock);
|
||||||
pg = LIST_FIRST(&freeList);
|
pg = LIST_FIRST(&freeList);
|
||||||
|
ASSERT(pg != NULL);
|
||||||
LIST_REMOVE(pg, entries);
|
LIST_REMOVE(pg, entries);
|
||||||
|
|
||||||
|
ASSERT(pg->magic == FREEPAGE_MAGIC_FREE);
|
||||||
|
|
||||||
info = PAllocGetInfo(pg);
|
info = PAllocGetInfo(pg);
|
||||||
|
ASSERT(info != NULL);
|
||||||
ASSERT(info->refCount == 0);
|
ASSERT(info->refCount == 0);
|
||||||
info->refCount++;
|
info->refCount++;
|
||||||
|
|
||||||
ASSERT(pg->magic == FREEPAGE_MAGIC_FREE);
|
|
||||||
pg->magic = FREEPAGE_MAGIC_INUSE;
|
pg->magic = FREEPAGE_MAGIC_INUSE;
|
||||||
|
|
||||||
freePages--;
|
freePages--;
|
||||||
|
Loading…
Reference in New Issue
Block a user