Turnstone Operating System
|
a simple heap implementation More...
#include <memory.h>
#include <systeminfo.h>
#include <cpu.h>
#include <cpu/task.h>
#include <logging.h>
#include <cpu/sync.h>
#include <linker.h>
#include <utils.h>
Classes | |
struct | heapinfo_t |
heap info struct More... | |
struct | heapmetainfo_t |
heap info struct More... | |
struct | heapmetainfo_t::fast_classes_t |
Macros | |
#define | HEAP_INFO_FLAG_STARTEND (1 << 0) |
#define | HEAP_INFO_FLAG_USED (1 << 1) |
#define | HEAP_INFO_FLAG_NOTUSED (0 << 1) |
#define | HEAP_INFO_FLAG_HEAP (1 << 4) |
#define | HEAP_INFO_FLAG_HEAP_INITED (HEAP_INFO_FLAG_HEAP | HEAP_INFO_FLAG_USED) |
#define | HEAP_INFO_MAGIC (0xaa55) |
#define | HEAP_INFO_PADDING (0xaa55aa55) |
#define | HEAP_HEADER HEAP_INFO_PADDING |
Typedefs | |
typedef struct heapinfo_t | heapinfo_t |
short hand for struct | |
typedef struct heapmetainfo_t | heapmetainfo_t |
short hand for struct | |
Functions | |
void | memory_heap_backtrace (void) |
MODULE ("turnstone.lib.memory") | |
void * | memory_simple_malloc_ext (memory_heap_t *heap, size_t size, size_t align) |
simple heap malloc implementation More... | |
int8_t | memory_simple_free (memory_heap_t *heap, void *address) |
simple heap free implementation More... | |
void | memory_simple_stat (memory_heap_t *heap, memory_heap_stat_t *stat) |
memory_heap_t * | memory_create_heap_simple (size_t start, size_t end) |
creates simple heap More... | |
static void | memory_simple_insert_sorted (heapmetainfo_t *heap, int8_t tofull, heapinfo_t *item) |
a simple heap implementation
This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.
#define HEAP_HEADER HEAP_INFO_PADDING |
heap header
#define HEAP_INFO_FLAG_HEAP (1 << 4) |
heap metadata flag
#define HEAP_INFO_FLAG_HEAP_INITED (HEAP_INFO_FLAG_HEAP | HEAP_INFO_FLAG_USED) |
heap initilized flag
#define HEAP_INFO_FLAG_NOTUSED (0 << 1) |
unused heap hole flag
#define HEAP_INFO_FLAG_STARTEND (1 << 0) |
heap flag for heap start and end hi
#define HEAP_INFO_FLAG_USED (1 << 1) |
used heap hole flag
#define HEAP_INFO_MAGIC (0xaa55) |
heap magic for protection
#define HEAP_INFO_PADDING (0xaa55aa55) |
heap padding for protection
memory_heap_t * memory_create_heap_simple | ( | size_t | start, |
size_t | end | ||
) |
creates simple heap
[in] | start | start address of heap |
[in] | end | end address of heap |
int8_t memory_simple_free | ( | memory_heap_t * | heap, |
void * | address | ||
) |
simple heap free implementation
[in] | heap | simple heap (itself) |
[in] | address | address to free |
void * memory_simple_malloc_ext | ( | memory_heap_t * | heap, |
size_t | size, | ||
size_t | align | ||
) |
simple heap malloc implementation
[in] | heap | simple heap (itself) |
[in] | size | size of memory |
[in] | align | align value |