#include "imports.h"
Data Structures | |
struct | mem_block |
Memory manager code. More... | |
Functions | |
struct mem_block * | mmInit (unsigned ofs, unsigned size) |
input: total size in bytes return: a heap pointer if OK, NULL if error | |
struct mem_block * | mmAllocMem (struct mem_block *heap, unsigned size, unsigned align2, unsigned startSearch) |
Allocate 'size' bytes with 2^align2 bytes alignment, restrict the search to free memory after 'startSearch' depth and back buffers should be in different 4mb banks to get better page hits if possible input: size = size of block align2 = 2^align2 bytes alignment startSearch = linear offset from start of heap to begin search return: pointer to the allocated block, 0 if error. | |
int | mmFreeMem (struct mem_block *b) |
Free block starts at offset input: pointer to a block return: 0 if OK, -1 if error. | |
struct mem_block * | mmFindBlock (struct mem_block *heap, unsigned start) |
Free block starts at offset input: pointer to a heap, start offset return: pointer to a block. | |
void | mmDestroy (struct mem_block *mmInit) |
destroy MM | |
void | mmDumpMemInfo (const struct mem_block *mmInit) |
For debuging purpose. |
struct mem_block* mmAllocMem | ( | struct mem_block * | heap, | |
unsigned | size, | |||
unsigned | align2, | |||
unsigned | startSearch | |||
) | [read] |
Allocate 'size' bytes with 2^align2 bytes alignment, restrict the search to free memory after 'startSearch' depth and back buffers should be in different 4mb banks to get better page hits if possible input: size = size of block align2 = 2^align2 bytes alignment startSearch = linear offset from start of heap to begin search return: pointer to the allocated block, 0 if error.
void mmDestroy | ( | struct mem_block * | mmInit | ) |
destroy MM
void mmDumpMemInfo | ( | const struct mem_block * | mmInit | ) |
For debuging purpose.
Free block starts at offset input: pointer to a heap, start offset return: pointer to a block.
int mmFreeMem | ( | struct mem_block * | b | ) |
Free block starts at offset input: pointer to a block return: 0 if OK, -1 if error.
struct mem_block* mmInit | ( | unsigned | ofs, | |
unsigned | size | |||
) | [read] |
input: total size in bytes return: a heap pointer if OK, NULL if error