Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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>
  • Loading branch information
mcb30 committed Mar 26, 2012
1 parent 920799a commit 2834f9f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/arch/i386/interface/pcbios/memtop_umalloc.c
Expand Up @@ -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 );
Expand Down

0 comments on commit 2834f9f

Please sign in to comment.