MyOS Libc
|
Data Structures | |
struct | heap_block |
Macros | |
#define | MAX_BLOCKS 512 |
Maximum number of blocks that can be used. | |
Functions | |
static char | get_bmap_bit (char *bmap, size_t index) |
static void | set_bmap_bit (char *bmap, size_t index) |
static void | clear_bmap_bit (char *bmap, size_t index) |
static void | reserve_block (size_t mem_blks) |
void * | malloc (size_t size) |
void * | realloc (void *mem, size_t new_sz) |
void | free (void *mem) |
Variables | |
static heap_block | entries [MAX_BLOCKS] |
List of blocks in the heap. | |
static size_t | num_used_entries =0 |
Number of blocks in the heap. | |
|
static |
Clear a bit in a bitmap
bmap | The bitmap |
index | The index in the bitmap |
void free | ( | void * | mem | ) |
Frees a block of memory on the heap
mem | The block of memory to free |
|
static |
Get a bit in a bitmap
bmap | The bitmap |
index | The index in the bitmap |
void* malloc | ( | size_t | size | ) |
Allocates a block of memory on the heap
size | The size of the block to allocate |
void* realloc | ( | void * | mem, |
size_t | new_sz | ||
) |
Changes a block of memory on the heap to a new size, or if mem is NULL, act like malloc
mem | The block of memory to change size |
new_sz | The size of the block to allocate |
|
static |
Add a block to the heap
mem_blks | The number of pages that this block will use |
|
static |
Set a bit in a bitmap
bmap | The bitmap |
index | The index in the bitmap |