mirror of
https://review.haiku-os.org/haiku
synced 2024-11-23 15:28:58 +01:00
bootloader: Round up heap region allocation sizes to B_PAGE_SIZE.
In testing, the allocation sizes I was seeing were all multiples of the page size anyway, but of course there's no requirement that they are, so we need to round here. Pointed out by mmlr.
This commit is contained in:
parent
8b813adf6d
commit
2116682cac
@ -668,6 +668,7 @@ platform_free_region(void *address, size_t size)
|
||||
ssize_t
|
||||
platform_allocate_heap_region(size_t size, void **_base)
|
||||
{
|
||||
size = ROUNDUP(size, B_PAGE_SIZE);
|
||||
addr_t base = get_next_physical_address(size);
|
||||
if (base == 0)
|
||||
return B_NO_MEMORY;
|
||||
|
@ -666,6 +666,7 @@ platform_free_region(void *address, size_t size)
|
||||
ssize_t
|
||||
platform_allocate_heap_region(size_t size, void **_base)
|
||||
{
|
||||
size = ROUNDUP(size, B_PAGE_SIZE);
|
||||
addr_t base = get_next_physical_address(size);
|
||||
if (base == 0)
|
||||
return B_NO_MEMORY;
|
||||
|
@ -671,6 +671,7 @@ platform_free_region(void *address, size_t size)
|
||||
ssize_t
|
||||
platform_allocate_heap_region(size_t size, void **_base)
|
||||
{
|
||||
size = ROUNDUP(size, B_PAGE_SIZE);
|
||||
addr_t base = get_next_physical_address(size);
|
||||
if (base == 0)
|
||||
return B_NO_MEMORY;
|
||||
|
@ -826,6 +826,7 @@ platform_free_region(void *address, size_t size)
|
||||
ssize_t
|
||||
platform_allocate_heap_region(size_t size, void **_base)
|
||||
{
|
||||
size = ROUNDUP(size, B_PAGE_SIZE);
|
||||
addr_t base = allocate_physical(size, false);
|
||||
if (base == 0)
|
||||
return B_NO_MEMORY;
|
||||
|
Loading…
Reference in New Issue
Block a user