Переглянути джерело

[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>
tags/v1.20.1
Michael Brown 12 роки тому
джерело
коміт
2834f9f6de
1 змінених файлів з 2 додано та 1 видалено
  1. 2
    1
      src/arch/i386/interface/pcbios/memtop_umalloc.c

+ 2
- 1
src/arch/i386/interface/pcbios/memtop_umalloc.c Переглянути файл

@@ -208,7 +208,8 @@ static userptr_t memtop_urealloc ( userptr_t ptr, size_t new_size ) {
208 208
 
209 209
 	/* Collect any free blocks and update hidden memory region */
210 210
 	ecollect_free();
211
-	hide_umalloc ( user_to_phys ( bottom, 0 ),
211
+	hide_umalloc ( user_to_phys ( bottom, ( ( bottom == top ) ?
212
+						0 : -sizeof ( extmem ) ) ),
212 213
 		       user_to_phys ( top, 0 ) );
213 214
 
214 215
 	return ( new_size ? new : UNOWHERE );

Завантаження…
Відмінити
Зберегти