Dynamic memory management.
#include <srl_memory.hpp>
Classes | |
class | CartRam |
Malloc for expansion cart RAM. More... | |
class | HighWorkRam |
Malloc for main system RAM. More... | |
class | LowWorkRam |
Malloc for slower system RAM. More... | |
struct | Report |
Contains report of the state. More... | |
Public Types | |
enum | Zone { HWRam = 0 , LWRam = 1 , CartRam = 2 } |
Memory zone codes. More... | |
Static Public Member Functions | |
static void | Free (void *ptr) |
Free allocated memory from any memory zone. | |
static size_t | GetFreeSpace (const Zone zone) |
Gets total size of the free space in the memory zone. | |
static size_t | GetSize (const Zone zone) |
Gets total size of the memory zone. | |
static size_t | GetUsedSpace (const Zone zone) |
Gets total size of the used space in the memory zone. | |
static void | Initialize () |
Initialize memory. | |
static void * | Malloc (size_t size, const SRL::Memory::Zone zone) |
Allocate some memory in specified zone. | |
static void | MemSet (void *destination, const uint8_t value, const size_t length) |
Det memory to some value. | |
static void * | PlacementMalloc (size_t size, uint32_t address) |
Allocate some memory in zone containing specified address. | |
static void * | PlacementMalloc (size_t size, void *address) |
Allocate some memory in zone containing specified address. | |
Related Symbols | |
(Note that these are not member symbols.) | |
#define | autonew new(reinterpret_cast<uint32_t>(this)) |
Allocates memory in the same zone as current context. | |
#define | cartnew new (SRL::Memory::Zone::CartRam) |
new keyword for expansion cartridge RAM | |
#define | hwnew new |
new keyword for high work RAM | |
#define | lwnew new (SRL::Memory::Zone::LWRam) |
new keyword for low work RAM | |
enum SRL::Memory::Zone |
Memory zone codes.
Enumerator | |
---|---|
HWRam | High (main) system RAM. |
LWRam | Low system RAM. |
CartRam | Expansion cart RAM. |
|
inlinestatic |
Free allocated memory from any memory zone.
ptr | Pointer to allocated memory |
|
inlinestatic |
Gets total size of the free space in the memory zone.
zone | Memory zone |
|
inlinestatic |
|
inlinestatic |
Gets total size of the used space in the memory zone.
zone | Memory zone |
|
inlinestatic |
Allocate some memory in specified zone.
size | Number of bytes to allocate |
zone | Memory zone |
|
inlinestatic |
Det memory to some value.
destination | Destination to set |
value | Value to set |
length | Data length to set |
|
inlinestatic |
Allocate some memory in zone containing specified address.
size | Number of bytes to allocate |
address | Address in the memory where object should be allocated |
|
inlinestatic |
Allocate some memory in zone containing specified address.
size | Number of bytes to allocate |
address | Address in the memory where object should be allocated |
|
related |
Allocates memory in the same zone as current context.
this
keyword is present in.
|
related |
new
keyword for expansion cartridge RAM
|
related |
new
keyword for high work RAM
|
related |
new
keyword for low work RAM