mirror of
https://github.com/xcat2/xNBA.git
synced 2025-02-15 01:58:22 +00:00
[umalloc] Unhide umalloc()ed memory region when there are no allocations
At present, we always hide an extra sizeof(struct external_memory), to account for the header on the lowest allocated block. This header ceases to exist when there are no allocated blocks remaining. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
parent
920799a0ba
commit
2834f9f6de
@ -208,7 +208,8 @@ static userptr_t memtop_urealloc ( userptr_t ptr, size_t new_size ) {
|
||||
|
||||
/* Collect any free blocks and update hidden memory region */
|
||||
ecollect_free();
|
||||
hide_umalloc ( user_to_phys ( bottom, 0 ),
|
||||
hide_umalloc ( user_to_phys ( bottom, ( ( bottom == top ) ?
|
||||
0 : -sizeof ( extmem ) ) ),
|
||||
user_to_phys ( top, 0 ) );
|
||||
|
||||
return ( new_size ? new : UNOWHERE );
|
||||
|
Loading…
x
Reference in New Issue
Block a user