diff --git a/service/ptos/ex/pool.c b/service/ptos/ex/pool.c index 08e4ca0..dc696ad 100644 --- a/service/ptos/ex/pool.c +++ b/service/ptos/ex/pool.c @@ -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) {