From 7d813fb6d3621ff5a7a901c2d4dd56ab45bbb76f Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Sat, 26 Jan 2019 10:21:58 -0600 Subject: [PATCH] mm/mm_gran/mm_pgalloc.c: mm/pgalloc: shouldn't just allocate one page always. --- mm/mm_gran/mm_pgalloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/mm_gran/mm_pgalloc.c b/mm/mm_gran/mm_pgalloc.c index 69e52d03d3..b0a939b109 100644 --- a/mm/mm_gran/mm_pgalloc.c +++ b/mm/mm_gran/mm_pgalloc.c @@ -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); } /****************************************************************************