mutek/mem_alloc.h header reference
[Kernel services module]
The source code of this header can be browsed online.
Description [link]
Memory allocation stuff
Members [link]
Type [link]
- enum mem_scope_e
Functions [link]
- void * mem_alloc(size_t size, enum mem_scope_e scope)
- void * mem_alloc_align(size_t size, size_t align, enum mem_scope_e scope)
- void * mem_alloc_cpu(size_t size, enum mem_scope_e scope, cpu_id_t cpu_id)
- void mem_check(void )
- void mem_free(void *ptr)
- size_t mem_getsize(void *ptr)
- void * mem_resize(void *ptr, size_t size)
- void memory_allocator_dumpk(struct memory_allocator_region_s *region)
- struct memory_allocator_header_s * memory_allocator_extend(struct memory_allocator_region_s *region, void *start, size_t size)
- size_t memory_allocator_getsize(void *ptr)
- struct memory_allocator_region_s * memory_allocator_init(struct memory_allocator_region_s *container_region, void *start, void *end)
- void * memory_allocator_pop(struct memory_allocator_region_s *region, size_t size, size_t align)
- void memory_allocator_push(void *address)
- void * memory_allocator_region_address(struct memory_allocator_region_s *region)
- void memory_allocator_region_check(struct memory_allocator_region_s *region)
- size_t memory_allocator_region_size(struct memory_allocator_region_s *region)
- void * memory_allocator_reserve(struct memory_allocator_region_s *region, void *start, size_t size)
- void * memory_allocator_resize(void *address, size_t size)
- error_t memory_allocator_stats(struct memory_allocator_region_s *region, size_t *alloc_blocks, size_t *free_size, size_t *free_blocks)
Variable [link]
- struct memory_allocator_region_s * default_region
Members detail [link]
#define MEM_ALLOC_H_ [link]
This macro is declared in mutek/mem_alloc.h source file, line 30.
void * mem_alloc(size_t size, enum mem_scope_e scope) [link]
This function is declared in mutek/mem_alloc.h source file, line 153.
This function allocates a new memory block in given scope.
This is available when CONFIG_MUTEK_MEMALLOC is defined.
void * mem_alloc_align(size_t size, size_t align, enum mem_scope_e scope) [link]
This function is declared in mutek/mem_alloc.h source file, line 146.
this function allocates a new memory block in given scope with specified alignment constraint.
This is available when CONFIG_MUTEK_MEMALLOC is defined.
See also CONFIG_MUTEK_MEMALLOC_ALIGN.
void * mem_alloc_cpu(size_t size, enum mem_scope_e scope, cpu_id_t cpu_id) [link]
This function is declared in mutek/mem_alloc.h source file, line 187.
This function allocate a new memory block for another cpu in given scope
This is available when CONFIG_MUTEK_MEMALLOC is defined.
void mem_check(void ) [link]
This function is declared in mutek/mem_alloc.h source file, line 109.
This function checks memory allocator structures.
This is available when CONFIG_MUTEK_MEMALLOC is defined.
See also CONFIG_MUTEK_MEMALLOC_CRC, CONFIG_MUTEK_MEMALLOC_GUARD, CONFIG_MUTEK_MEMALLOC_SCRAMBLE and CONFIG_MUTEK_MEMALLOC_STATS.
void mem_free(void *ptr) [link]
This function is declared in mutek/mem_alloc.h source file, line 194.
This function frees allocated memory block
This is available when CONFIG_MUTEK_MEMALLOC is defined.
size_t mem_getsize(void *ptr) [link]
This function is declared in mutek/mem_alloc.h source file, line 201.
This function returns the size of given memory block
This is available when CONFIG_MUTEK_MEMALLOC_SMART is defined.
void * mem_resize(void *ptr, size_t size) [link]
This function is declared in mutek/mem_alloc.h source file, line 211.
This function resizes the given memory block, return NULL if failed. The allocated memory block is not moved; if not enough free memory blocks are available next to allocated memory, this function fails.
This is available when CONFIG_MUTEK_MEMALLOC_SMART is defined.
enum mem_scope_e [link]
This enum is declared in mutek/mem_alloc.h source file, line 90.
Identifier | Description |
---|---|
mem_scope_sys | |
mem_scope_cluster | |
mem_scope_context | |
mem_scope_cpu | |
mem_scope_default | |
mem_scope_e_count |
void memory_allocator_dumpk(struct memory_allocator_region_s *region) [link]
This function is declared in mutek/mem_alloc.h source file, line 83.
This function dumps the list of memory allocator blocks of the specified region.
This is available when CONFIG_MUTEK_PRINTK and CONFIG_MUTEK_MEMALLOC_SMART are both defined.
struct memory_allocator_region_s * default_region [link]
This variable is declared in mutek/mem_alloc.h source file, line 40.
This variable is for internal use only.
struct memory_allocator_header_s * memory_allocator_extend(struct memory_allocator_region_s *region, void *start, size_t size) [link]
This function is declared in mutek/mem_alloc.h source file, line 48.
this function extend an existing memory region with a new memory space
This function is for internal use only.
size_t memory_allocator_getsize(void *ptr) [link]
This function is declared in mutek/mem_alloc.h source file, line 63.
this function return the size of given memory block
This function is for internal use only.
struct memory_allocator_region_s * memory_allocator_init(struct memory_allocator_region_s *container_region, void *start, void *end) [link]
This function is declared in mutek/mem_alloc.h source file, line 44.
this function initialize a memory region
This function is for internal use only.
void * memory_allocator_pop(struct memory_allocator_region_s *region, size_t size, size_t align) [link]
This function is declared in mutek/mem_alloc.h source file, line 54.
this function allocate a new memory block in given region
This function is for internal use only.
void memory_allocator_push(void *address) [link]
This function is declared in mutek/mem_alloc.h source file, line 57.
this function free allocated memory block
This function is for internal use only.
void * memory_allocator_region_address(struct memory_allocator_region_s *region) [link]
This function is declared in mutek/mem_alloc.h source file, line 79.
this function return the size of given memory region
This function is for internal use only.
void memory_allocator_region_check(struct memory_allocator_region_s *region) [link]
This function is declared in mutek/mem_alloc.h source file, line 73.
this function make memory region check depending to activated token: guard zone, headers' integrity (crc and size) and if free space was used
This function is for internal use only.
size_t memory_allocator_region_size(struct memory_allocator_region_s *region) [link]
This function is declared in mutek/mem_alloc.h source file, line 76.
this function return the size of given memory region
This function is for internal use only.
void * memory_allocator_reserve(struct memory_allocator_region_s *region, void *start, size_t size) [link]
This function is declared in mutek/mem_alloc.h source file, line 60.
this function reserve a memory space in given region
This function is for internal use only.
void * memory_allocator_resize(void *address, size_t size) [link]
This function is declared in mutek/mem_alloc.h source file, line 51.
this function resize the given memory block
This function is for internal use only.
error_t memory_allocator_stats(struct memory_allocator_region_s *region, size_t *alloc_blocks, size_t *free_size, size_t *free_blocks) [link]
This function is declared in mutek/mem_alloc.h source file, line 69.
this function return statistic of memory region use
This function is for internal use only.