| Turnstone Operating System
    | 
main memory interface and functions implementation More...
| Typedefs | |
| typedef task_t *(* | memory_current_task_getter_f) (void) | 
| typedef void(* | memory_backtrace_f) (void) | 
| Functions | |
| MODULE ("turnstone.lib.memory") | |
| void | memory_set_current_task_getter (memory_current_task_getter_f getter) | 
| static task_t * | memory_get_current_task (void) | 
| memory_heap_t * | memory_set_default_heap (memory_heap_t *heap) | 
| sets default heap | |
| memory_heap_t * | memory_get_default_heap (void) | 
| returns default heap | |
| memory_heap_t * | memory_get_heap (memory_heap_t *heap) | 
| returns heap, finds correct heap for task. | |
| void * | memory_malloc_ext (memory_heap_t *heap, size_t size, size_t align) | 
| malloc memory | |
| int8_t | memory_free_ext (memory_heap_t *heap, void *address) | 
| frees memory | |
| void | memory_get_heap_stat_ext (memory_heap_t *heap, memory_heap_stat_t *stat) | 
| returns stats for heap | |
| int8_t | memory_memset (register void *address, register uint8_t value, register size_t size) | 
| int8_t | memory_memcopy (const void *source, void *destination, size_t size) | 
| copy source to destination with length bytes from source | |
| int8_t | memory_memcompare (const void *mem1, const void *mem2, size_t size) | 
| compares first length bytes of mem1 with mem2 | |
| int8_t | memory_memclean (register void *address, register size_t size) | 
| void | memory_heap_backtrace (void) | 
| Variables | |
| memory_heap_t * | memory_heap_default = NULL | 
| memory_current_task_getter_f | memory_current_task_getter = NULL | 
| memory_backtrace_f | memory_heap_backtrace_func = NULL | 
main memory interface and functions implementation
This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.
| int8_t memory_free_ext | ( | memory_heap_t * | heap, | 
| void * | address ) | 
frees memory
| [in] | heap | the heap where the address is. | 
| [in] | address | address to free | 
if heap is NULL, address will be freed at default heap
| memory_heap_t * memory_get_default_heap | ( | void | ) | 
returns default heap
| memory_heap_t * memory_get_heap | ( | memory_heap_t * | heap | ) | 
returns heap, finds correct heap for task.
| void memory_get_heap_stat_ext | ( | memory_heap_t * | heap, | 
| memory_heap_stat_t * | stat ) | 
returns stats for heap
| [in] | heap | heap which stats will be collected | 
| [out] | stat | returned stats | 
| void * memory_malloc_ext | ( | memory_heap_t * | heap, | 
| size_t | size, | ||
| size_t | align ) | 
malloc memory
| [in] | heap | the heap used for malloc | 
| [in] | size | size of variable | 
| [in] | align | address of variable aligned at. | 
if heap is NULL, variable allocated at default heap.
compares first length bytes of mem1 with mem2
| mem1 | first memory address | 
| mem2 | second memory address | 
| size | count of bytes for compare | 
copy source to destination with length bytes from source
| [in] | source | source address | 
| [in] | destination | destination address | 
| [in] | size | how many bytes will be copied | 
if destination is smaller then length a memory corruption will be happend
| memory_heap_t * memory_set_default_heap | ( | memory_heap_t * | heap | ) | 
sets default heap
| [in] | heap | the heap will be the default one | 
| memory_heap_t* memory_heap_default = NULL | 
default heap variable