|
iPXE
|
A heap. More...
#include <malloc.h>
Data Fields | |
| struct list_head | blocks |
| List of free memory blocks. More... | |
| size_t | align |
| Alignment for free memory blocks. More... | |
| size_t | ptr_align |
| Alignment for size-tracked allocations. More... | |
| size_t | freemem |
| Total amount of free memory. More... | |
| size_t | usedmem |
| Total amount of used memory. More... | |
| size_t | maxusedmem |
| Maximum amount of used memory. More... | |
| unsigned int(* | grow )(size_t size) |
| Attempt to grow heap (optional) More... | |
| unsigned int(* | shrink )(void *ptr, size_t size) |
| Allow heap to shrink (optional) More... | |
| struct list_head heap::blocks |
List of free memory blocks.
Definition at line 46 of file malloc.h.
Referenced by check_blocks(), heap_alloc_block(), heap_dump(), heap_free_block(), init_heap(), valgrind_make_blocks_defined(), and valgrind_make_blocks_noaccess().
| size_t heap::align |
Alignment for free memory blocks.
Definition at line 49 of file malloc.h.
Referenced by check_blocks(), heap_alloc_block(), heap_free_block(), and heap_populate().
| size_t heap::ptr_align |
Alignment for size-tracked allocations.
Definition at line 51 of file malloc.h.
Referenced by heap_realloc().
| size_t heap::freemem |
Total amount of free memory.
Definition at line 54 of file malloc.h.
Referenced by heap_alloc_block(), and heap_free_block().
| size_t heap::usedmem |
Total amount of used memory.
Definition at line 56 of file malloc.h.
Referenced by heap_alloc_block(), heap_free_block(), and heap_populate().
| size_t heap::maxusedmem |
Maximum amount of used memory.
Definition at line 58 of file malloc.h.
Referenced by heap_alloc_block(), and shutdown_cache().
Attempt to grow heap (optional)
| size | Failed allocation size |
| grown | Heap has grown: retry allocations |
Definition at line 66 of file malloc.h.
Referenced by heap_alloc_block().
Allow heap to shrink (optional)
| ptr | Start of free block |
| size | Size of free block |
| shrunk | Heap has shrunk: discard block |
Note that the discarded block will be accessed once after this method returns, in order to clear the free block metadata.
Definition at line 78 of file malloc.h.
Referenced by heap_free_block().
1.8.15