Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches

Memory Provider for Deki Engine. More...

#include <DekiMemory.h>

Static Public Member Functions

static bool Initialize ()
 Initialize memory backend.
static void Shutdown ()
 Shutdown memory backend.
static void SetBackend (IMemoryProvider *backend)
 Set the memory provider implementation directly.
static bool IsInitialized ()
 Check if the memory backend is initialized.
static void * Allocate (size_t size, bool prefer_psram=false, const char *context=nullptr)
 Allocate memory.
static void * AllocateInternal (size_t size, const char *context=nullptr)
 Allocate memory from internal RAM only (never external/PSRAM).
static void FreeInternal (void *ptr)
 Free memory allocated via AllocateInternal.
static void Free (void *ptr, const char *context=nullptr)
static DekiMemoryStats GetStats ()
 Get current memory statistics.
static size_t GetAvailablePSRAM ()
 Get available PSRAM size.
static bool IsPSRAMAvailable ()
 Check if PSRAM is available.

Detailed Description

Memory Provider for Deki Engine.

Provides centralized memory management with PSRAM support. Handles PSRAM usage and RAM allocation limits for the Deki.

Member Function Documentation

◆ Initialize()

bool DekiMemory::Initialize ( )
static

Initialize memory backend.

Returns
true if initialization successful

◆ Shutdown()

void DekiMemory::Shutdown ( )
static

Shutdown memory backend.

◆ SetBackend()

void DekiMemory::SetBackend ( IMemoryProvider * backend)
static

Set the memory provider implementation directly.

Parameters
backendPointer to provider (takes ownership)

◆ IsInitialized()

bool DekiMemory::IsInitialized ( )
static

Check if the memory backend is initialized.

Returns
true if initialized, false otherwise

◆ Allocate()

void * DekiMemory::Allocate ( size_t size,
bool prefer_psram = false,
const char * context = nullptr )
static

Allocate memory.

Parameters
sizeSize in bytes to allocate
prefer_psramWhether to prefer PSRAM for this allocation
contextOptional context string for debugging
Returns
Pointer to allocated memory, or nullptr if failed

◆ AllocateInternal()

void * DekiMemory::AllocateInternal ( size_t size,
const char * context = nullptr )
static

Allocate memory from internal RAM only (never external/PSRAM).

Parameters
sizeSize in bytes to allocate
contextOptional context string for debugging
Returns
Pointer to allocated memory, or nullptr if failed

◆ FreeInternal()

void DekiMemory::FreeInternal ( void * ptr)
static

Free memory allocated via AllocateInternal.

Parameters
ptrPointer to memory to free

◆ Free()

void DekiMemory::Free ( void * ptr,
const char * context = nullptr )
static

◆ GetStats()

DekiMemoryStats DekiMemory::GetStats ( )
static

Get current memory statistics.

Returns
Memory stats structure

◆ GetAvailablePSRAM()

size_t DekiMemory::GetAvailablePSRAM ( )
static

Get available PSRAM size.

Returns
Available PSRAM size in bytes (0 if no PSRAM)

◆ IsPSRAMAvailable()

bool DekiMemory::IsPSRAMAvailable ( )
static

Check if PSRAM is available.

Returns
true if PSRAM available

The documentation for this class was generated from the following file: