sandbox: memblock: align allocated pointers to 16-byte boundary
This commit is contained in:
@@ -239,6 +239,11 @@ static phys_addr_t do_alloc(size_t size)
|
|||||||
|
|
||||||
memblock_iter_t it;
|
memblock_iter_t it;
|
||||||
for_each_free_mem_range (&it, region_start, region_end) {
|
for_each_free_mem_range (&it, region_start, region_end) {
|
||||||
|
if (it.it_base & 0xF) {
|
||||||
|
it.it_base &= ~0xF;
|
||||||
|
it.it_base += 0x10;
|
||||||
|
}
|
||||||
|
|
||||||
size_t region_size = it.it_limit - it.it_base + 1;
|
size_t region_size = it.it_limit - it.it_base + 1;
|
||||||
if (region_size >= size) {
|
if (region_size >= size) {
|
||||||
allocated_base = it.it_base;
|
allocated_base = it.it_base;
|
||||||
|
|||||||
Reference in New Issue
Block a user