Memory Provider for Deki Engine.
More...
#include <DekiMemory.h>
|
| 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.
|
Memory Provider for Deki Engine.
Provides centralized memory management with PSRAM support. Handles PSRAM usage and RAM allocation limits for the Deki.
◆ Initialize()
| bool DekiMemory::Initialize |
( |
| ) |
|
|
static |
Initialize memory backend.
- Returns
- true if initialization successful
◆ Shutdown()
| void DekiMemory::Shutdown |
( |
| ) |
|
|
static |
◆ SetBackend()
Set the memory provider implementation directly.
- Parameters
-
| backend | Pointer 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
-
| size | Size in bytes to allocate |
| prefer_psram | Whether to prefer PSRAM for this allocation |
| context | Optional 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
-
| size | Size in bytes to allocate |
| context | Optional 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
-
| ptr | Pointer to memory to free |
◆ Free()
| void DekiMemory::Free |
( |
void * | ptr, |
|
|
const char * | context = nullptr ) |
|
static |
◆ GetStats()
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: