mirror of
https://github.com/apache/nuttx.git
synced 2026-05-30 21:36:28 +08:00
mm/mm_gran/mm_pgalloc.c: mm/pgalloc: shouldn't just allocate one page always.
This commit is contained in:
@@ -122,7 +122,7 @@ static GRAN_HANDLE g_pgalloc;
|
|||||||
void mm_pginitialize(FAR void *heap_start, size_t heap_size)
|
void mm_pginitialize(FAR void *heap_start, size_t heap_size)
|
||||||
{
|
{
|
||||||
g_pgalloc = gran_initialize(heap_start, heap_size, MM_PGSHIFT, MM_PGSHIFT);
|
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)
|
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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|||||||
Reference in New Issue
Block a user