ptos: pool: Align ByteCount before ChunksNeeded div
Signed-off-by: Chloe M. <chloe@mensia.org>
This commit is contained in:
@@ -132,7 +132,7 @@ PoolAllocateFromPage(USIZE Gran, POOL_PAGE *Page, USIZE ByteCount, PAGE_INFO *In
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ChunksNeeded = ByteCount / Gran;
|
||||
ChunksNeeded = ALIGN_UP(ByteCount, Gran) / Gran;
|
||||
|
||||
/* Scan the page for free chunks */
|
||||
for (Idx = 0; Idx < sizeof(Page->Bitmap) * 8; ++Idx) {
|
||||
|
||||
Reference in New Issue
Block a user