SaturnRingLibrary 0.6
SGL wrapper
 
Loading...
Searching...
No Matches
SRL::Memory Class Reference

Detailed Description

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 MemSet (void *destination, const uint8_t value, const size_t length)
 Det memory to some value.
 

Member Enumeration Documentation

◆ Zone

Memory zone codes.

Enumerator
HWRam 

High (main) system RAM.

LWRam 

Low system RAM.

CartRam 

Expansion cart RAM.

Member Function Documentation

◆ Free()

static void SRL::Memory::Free ( void * ptr)
inlinestatic

Free allocated memory from any memory zone.

Parameters
ptrPointer to allocated memory

◆ GetFreeSpace()

static size_t SRL::Memory::GetFreeSpace ( const Zone zone)
inlinestatic

Gets total size of the free space in the memory zone.

Parameters
zoneMemory zone
Returns
Number of bytes

◆ GetSize()

static size_t SRL::Memory::GetSize ( const Zone zone)
inlinestatic

Gets total size of the memory zone.

Parameters
zoneMemory zone
Returns
Number of bytes

◆ GetUsedSpace()

static size_t SRL::Memory::GetUsedSpace ( const Zone zone)
inlinestatic

Gets total size of the used space in the memory zone.

Parameters
zoneMemory zone
Returns
Number of bytes

◆ MemSet()

static void SRL::Memory::MemSet ( void * destination,
const uint8_t value,
const size_t length )
inlinestatic

Det memory to some value.

Parameters
destinationDestination to set
valueValue to set
lengthData length to set