The Socrates Gameboy Advance Development Engine
The SGADE is a development library for the Nintendo Gameboy
Advance. It's free for all uses and is distributed without guarantees.
For more information visit
the SGADE page.
#include "SoMemManager.h"#include "SoDebug.h"Data Structures | |
| struct | SoMemManagerHdr_t |
| memory manager header More... | |
| struct | SoMemManagerNode_t |
| Free pool tree node. More... | |
Defines | |
| #define | SO_MEM_MANAGER_NULL_IDX |
| NULL node index ('pointer') value. | |
| #define | SoMemManagerHdr() |
| #define | SoMemManagerPoolArg() |
| #define | SoMemManagerAddx(iBlock) |
| #define | BITSPERBYTE |
| The number of bits in a byte. | |
Functions | |
| void | SoMemManagerInsertNode (u32 *pMemPool, u16 iParentNode, struct SoMemManagerNode_t *pParentNode, u16 iInsNode) |
| insert new node into (subtree of) free node tree | |
| void | SoMemManagerRemoveNode (u32 *pMemPool, u16 iNode, struct SoMemManagerNode_t *pNode) |
| Remove specified node from free pool tree. | |
| bool | SoMemManagerBitCheck (u8 *bmdata, u16 bitnum) |
| tests to see if bit in bitmap is set | |
| void | SoMemManagerBitSet (u8 *bmdata, u16 bitnum) |
| sets a bit in a bitmap | |
| void | SoMemManagerBitClear (u8 *bmdata, u16 bitnum) |
| clears a bit in a bitmap | |
| bool | IsFirstBlock (u32 *pMemPool, u16 iBlock) |
| tests to see if this is the first block in an free range | |
| bool | IsUsedBlock (u32 *pMemPool, u16 iBlock) |
| tests to see if the block is allocated | |
| void | SetBlockMemMap (u32 *pMemPool, u16 iBlock, u16 iSize, bool bOnOff) |
| sets an allocation range to used/free | |
| void | SoMemManagerInit (u32 *pMemPool, u32 iBufSize, u16 iBlockSize) |
| initialize memory pool for allocation | |
| void * | SoMemManagerAlloc (u32 *pMemPool, u16 iSize) |
| Allocate memory from free pool. | |
| void | SoMemManagerFree (void *pMemPool, void *pBuf) |
| Release memory back to free pool. | |
|
|
The number of bits in a byte.
For internal use only.
|
|
|
NULL node index ('pointer') value.
For internal use only.
|
|
|
For internal use only.
|
|
|
For internal use only.
|
|
|
For internal use only.
|
|
||||||||||||
|
tests to see if this is the first block in an free range
For internal use only.
|
|
||||||||||||
|
tests to see if the block is allocated
For internal use only.
|
|
||||||||||||||||||||
|
sets an allocation range to used/free
For internal use only.
|
|
||||||||||||
|
Allocate memory from free pool.
The memory allocated by this function is not zeroed or initialized to any value. Do not make any assumptions on the contents of the given memory. |
|
||||||||||||
|
tests to see if bit in bitmap is set
For internal use only.
Yes, I realize this isn't the most efficient way to do this... |
|
||||||||||||
|
clears a bit in a bitmap
For internal use only.
Yes, I realize this isn't the most efficient way to do this... |
|
||||||||||||
|
sets a bit in a bitmap
For internal use only.
Yes, I realize this isn't the most efficient way to do this... |
|
||||||||||||
|
Release memory back to free pool.
After this function is called the contents of the released memory is unpredictable and modifying it will likely cause a crash. Never make any assumptions about the memory after giving it to SoMemManagerFree. |
|
||||||||||||||||
|
initialize memory pool for allocation
|
|
||||||||||||||||||||
|
insert new node into (subtree of) free node tree
For internal use only.
|
|
||||||||||||||||
|
Remove specified node from free pool tree.
For internal use only.
|