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

Detailed Description

Malloc for expansion cart RAM.

#include <srl_memory.hpp>

Static Public Member Functions

static void Free (void *ptr)
 Free allocated memory.
 
static size_t GetFreeSpace ()
 Gets total size of the free space in the memory zone.
 
static const Report GetReport ()
 Gets report on the allocator state.
 
static size_t GetSize ()
 Gets total size of the memory zone.
 
static size_t GetUsedSpace ()
 Gets total size of the used space in the memory zone.
 
static bool InRange (uint32_t zoneAddress)
 Check whether pointer is in range of the memory zone.
 
static bool InRange (void *ptr)
 Check whether pointer is in range of the memory zone.
 
static void * Malloc (size_t size)
 Allocate some memory.
 
static void * Realloc (void *ptr, size_t size)
 Reallocate existing memory.
 

Member Function Documentation

◆ Free()

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

Free allocated memory.

Parameters
ptrPointer to allocated memory

◆ GetFreeSpace()

static size_t SRL::Memory::CartRam::GetFreeSpace ( )
inlinestatic

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

Returns
Number of bytes

◆ GetReport()

static const Report SRL::Memory::CartRam::GetReport ( )
inlinestatic

Gets report on the allocator state.

Returns
Current state of the allocator

◆ GetSize()

static size_t SRL::Memory::CartRam::GetSize ( )
inlinestatic

Gets total size of the memory zone.

Returns
Number of bytes

◆ GetUsedSpace()

static size_t SRL::Memory::CartRam::GetUsedSpace ( )
inlinestatic

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

Returns
Number of bytes

◆ InRange() [1/2]

static bool SRL::Memory::CartRam::InRange ( uint32_t zoneAddress)
inlinestatic

Check whether pointer is in range of the memory zone.

Parameters
zoneAddressAddress in the memory zone where object should be allocated
Returns
true if pointer belongs to the current memory zone

◆ InRange() [2/2]

static bool SRL::Memory::CartRam::InRange ( void * ptr)
inlinestatic

Check whether pointer is in range of the memory zone.

Parameters
ptrPointer to check
Returns
true if pointer belongs to the current memory zone

◆ Malloc()

static void * SRL::Memory::CartRam::Malloc ( size_t size)
inlinestatic

Allocate some memory.

Parameters
sizeNumber of bytes to allocate
Returns
Pointer to the allocated space in memory

◆ Realloc()

static void * SRL::Memory::CartRam::Realloc ( void * ptr,
size_t size )
inlinestatic

Reallocate existing memory.

Parameters
ptrPointer to the existing allocated memory
sizeNew size in number of bytes that should be allocated
Returns
Pointer to the allocated space in memory