mm/mm_gran/mm_pgalloc.c: mm/pgalloc: shouldn't just allocate one page always.
This commit is contained in:
parent
5a37ac25a9
commit
7d813fb6d3
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
|
|
Loading…
Reference in New Issue