Deluge Firmware 1.3.0
Build date: 2026.11.28
Loading...
Searching...
No Matches
GeneralMemoryAllocator Class Reference
Collaboration diagram for GeneralMemoryAllocator:

Public Member Functions

void * allocMaxSpeed (uint32_t requiredSize, void *thingNotToStealFrom=nullptr)
void * allocLowSpeed (uint32_t requiredSize, void *thingNotToStealFrom=nullptr)
template<std::derived_from< Stealable > T>
void * allocStealable (uint32_t requiredSize=sizeof(T), void *thingNotToStealFrom=nullptr)
void * alloc (uint32_t requiredSize, bool mayUseOnChipRam, bool makeStealable, void *thingNotToStealFrom)
void dealloc (void *address)
void * allocExternal (uint32_t requiredSize)
void * allocInternal (uint32_t requiredSize)
void deallocExternal (void *address)
uint32_t shortenRight (void *address, uint32_t newSize)
uint32_t shortenLeft (void *address, uint32_t amountToShorten, uint32_t numBytesToMoveRightIfSuccessful=0)
void extend (void *address, uint32_t minAmountToExtend, uint32_t idealAmountToExtend, uint32_t *getAmountExtendedLeft, uint32_t *getAmountExtendedRight, void *thingNotToStealFrom=nullptr)
uint32_t extendRightAsMuchAsEasilyPossible (void *address)
void test ()
uint32_t getAllocatedSize (void *address)
void checkStack (char const *caller)
void testShorten (int32_t i)
int32_t getRegion (void *address)
void testMemoryDeallocated (void *address)
void putStealableInQueue (Stealable *stealable, StealableQueue q)
void putStealableInAppropriateQueue (Stealable *stealable)

Static Public Member Functions

static GeneralMemoryAllocator & get ()

Public Attributes

MemoryRegion regions [NUM_MEMORY_REGIONS]
uint32_t stealableSectionsStart = 0
uint32_t stealableSectionsEnd = 0
CacheManager cacheManager
bool lock

Private Member Functions

void checkEverythingOk (char const *errorString)

Member Function Documentation

◆ allocStealable()

template<std::derived_from< Stealable > T>
void * GeneralMemoryAllocator::allocStealable ( uint32_t requiredSize = sizeof(T),
void * thingNotToStealFrom = nullptr )
inline

Stealable memory is marked SPACE_HEADER_STEALABLE, and the allocator calls Stealable's virtuals on whatever it finds there when grabbing neighbouring memory - so only a Stealable may be constructed in it. requiredSize covers any payload stored after the object.

Member Data Documentation

◆ stealableSectionsStart

uint32_t GeneralMemoryAllocator::stealableSectionsStart = 0

The stealable region's bounds, which unlike regions[MEMORY_REGION_STEALABLE].start / end don't leave room for its headers - so they're on 1MB MMU section boundaries. See GeneralMemoryAllocator().


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