Turnstone Operating System
Loading...
Searching...
No Matches
memory_heap_hash.xx.c File Reference

Turnstone OS memory heap with hash table implementation. More...

#include <memory.h>
#include <systeminfo.h>
#include <cpu.h>
#include <logging.h>
#include <cpu/sync.h>
#include <linker.h>
#include <utils.h>

Classes

struct  memory_heap_hash_block_t
 
struct  memory_heap_hash_fast_class_t
 
struct  memory_heap_hash_pool_t
 
struct  memory_heap_hash_metadata_t
 

Macros

#define MEMORY_HEAP_HASH_FAST_CLASSES_COUNT   1025
 
#define MEMORY_HEAP_HASH_MAX_POOLS   16
 

Typedefs

typedef struct memory_heap_hash_block_t memory_heap_hash_block_t
 
typedef struct memory_heap_hash_fast_class_t memory_heap_hash_fast_class_t
 
typedef struct memory_heap_hash_pool_t memory_heap_hash_pool_t
 
typedef struct memory_heap_hash_metadata_t memory_heap_hash_metadata_t
 

Functions

 MODULE ("turnstone.lib.memory")
 
void memory_heap_backtrace (void)
 
 _Static_assert (sizeof(memory_heap_hash_block_t)==16, "memory_heap_hash_block_t size is not 16 bytes")
 
static memory_heap_hash_pool_tmemory_heap_hash_pool_get (memory_heap_hash_metadata_t *metadata, uint16_t pool_id)
 
static memory_heap_hash_pool_tmemory_heap_hash_find_pool_by_address (memory_heap_hash_metadata_t *metadata, uint64_t address)
 
static memory_heap_hash_block_tmemory_heap_hash_pool_get_hash_block (memory_heap_hash_pool_t *pool, uint32_t block_address)
 
static void * memory_heap_hash_try_alloc_from_fast_class (memory_heap_hash_metadata_t *metadata, uint32_t size)
 
static void * memory_heap_hash_try_alloc_from_free_list (memory_heap_hash_metadata_t *metadata, uint64_t alignment, uint32_t size)
 
static memory_heap_hash_block_tmemory_heap_hash_pool_new_hash_block (memory_heap_hash_metadata_t *metadata, memory_heap_hash_pool_t *pool, uint32_t address, uint32_t size)
 
static memory_heap_hash_block_tmemory_heap_hash_pool_search_hash_block (memory_heap_hash_metadata_t *metadata, memory_heap_hash_pool_t *pool, uint32_t address)
 
void * memory_heap_hash_malloc_ext (memory_heap_t *heap, uint64_t size, uint64_t alignment)
 
int8_t memory_heap_hash_free (memory_heap_t *heap, void *ptr)
 
void memory_heap_hash_stat (memory_heap_t *heap, memory_heap_stat_t *stat)
 
static void memory_heap_hash_pool_insert_sorted_at_free_list (memory_heap_hash_pool_t *pool, memory_heap_hash_block_t *hash_block)
 
memory_heap_tmemory_create_heap_hash (uint64_t start, uint64_t end)
 creates hash backended heap More...
 

Detailed Description

Turnstone OS memory heap with hash table implementation.

This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.

Function Documentation

◆ memory_create_heap_hash()

memory_heap_t * memory_create_heap_hash ( size_t  start,
size_t  end 
)

creates hash backended heap

Parameters
[in]startstart address of heap
[in]endend address of heap
Returns
heap