mutek/mem_alloc.h header reference
[Kernel services module]

The source code of this header can be browsed online.

Description  

Memory allocation stuff

Members  

Type  

Functions  

Variable  

Members detail  

#define MEM_ALLOC_H_  

This macro is declared in mutek/mem_alloc.h source file, line 30.

void * mem_alloc(size_t size, enum mem_scope_e scope)  

This function is declared in mutek/mem_alloc.h source file, line 149.

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)  

This function is declared in mutek/mem_alloc.h source file, line 142.

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)  

This function is declared in mutek/mem_alloc.h source file, line 183.

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 )  

This function is declared in mutek/mem_alloc.h source file, line 105.

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)  

This function is declared in mutek/mem_alloc.h source file, line 190.

This function frees allocated memory block

This is available when CONFIG_MUTEK_MEMALLOC is defined.

size_t mem_getsize(void *ptr)  

This function is declared in mutek/mem_alloc.h source file, line 197.

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)  

This function is declared in mutek/mem_alloc.h source file, line 207.

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  

This enum is declared in mutek/mem_alloc.h source file, line 86.

IdentifierDescription
mem_scope_sys
mem_scope_cluster
mem_scope_context
mem_scope_cpu
mem_scope_default
mem_scope_e_count

struct memory_allocator_region_s * default_region  

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)  

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)  

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)  

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)  

this function allocate a new memory block in given region

This function is for internal use only.

void memory_allocator_push(void *address)  

this function free allocated memory block

This function is for internal use only.

void * memory_allocator_region_address(struct memory_allocator_region_s *region)  

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)  

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)  

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)  

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)  

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)  

this function return statistic of memory region use

This function is for internal use only.

Valid XHTML 1.0 StrictGenerated by diaxen on Wed Oct 17 21:18:38 2018 using MkDoc