41 #define NOWHERE ( ( void * ) ~( ( intptr_t ) 0 ) ) 102 #define CACHE_DISCARDERS __table ( struct cache_discarder, "cache_discarders" ) 105 #define __cache_discarder( cost ) __table_entry ( CACHE_DISCARDERS, cost ) 112 #define CACHE_CHEAP 01 113 #define CACHE_NORMAL 02 114 #define CACHE_EXPENSIVE 03 void free_phys(void *ptr, size_t size)
Free memory allocated with malloc_phys()
unsigned int(* shrink)(void *ptr, size_t size)
Allow heap to shrink (optional)
uint16_t size
Buffer size.
void * heap_realloc(struct heap *heap, void *old_ptr, size_t new_size)
Reallocate memory.
void *__malloc malloc_phys(size_t size, size_t phys_align)
Allocate memory with specified physical alignment.
A doubly-linked list entry (or list head)
uint32_t start
Starting offset.
unsigned int(* grow)(size_t size)
Attempt to grow heap (optional)
void heap_dump(struct heap *heap)
Dump free block list (for debugging)
unsigned int(* discard)(void)
Discard some cached data.
size_t ptr_align
Alignment for size-tracked allocations.
size_t maxusedmem
Maximum amount of used memory.
size_t freemem
Total amount of free memory.
struct list_head blocks
List of free memory blocks.
size_t usedmem
Total amount of used memory.
#define __malloc
Declare a pointer returned by a function as a unique memory address as returned by malloc-type functi...
void *__malloc malloc_phys_offset(size_t size, size_t phys_align, size_t offset)
Allocate memory with specified physical alignment and offset.
void heap_populate(struct heap *heap, void *start, size_t len)
Add memory to allocation pool.
uint16_t offset
Offset to command line.
size_t align
Alignment for free memory blocks.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)