mm/mm_gran/mm_pgalloc.c: mm/pgalloc: shouldn't just allocate one page always.

This commit is contained in:
Xiang Xiao 2019-01-26 10:21:58 -06:00 committed by Gregory Nutt
parent 5a37ac25a9
commit 7d813fb6d3
1 changed files with 2 additions and 2 deletions

View File

@ -122,7 +122,7 @@ static GRAN_HANDLE g_pgalloc;
void mm_pginitialize(FAR void *heap_start, size_t heap_size)
{
g_pgalloc = gran_initialize(heap_start, heap_size, MM_PGSHIFT, MM_PGSHIFT);
DEBUGASSERT(pg_alloc != NULL);
DEBUGASSERT(g_pgalloc != NULL);
}
/****************************************************************************
@ -169,7 +169,7 @@ void mm_pgreserve(uintptr_t start, size_t size)
uintptr_t mm_pgalloc(unsigned int npages)
{
return (uintptr_t)gran_alloc(g_pgalloc, (size_t)1 << MM_PGSHIFT);
return (uintptr_t)gran_alloc(g_pgalloc, (size_t)npages << MM_PGSHIFT);
}
/****************************************************************************