Skip to content

A memory allocator wrapper for Arduino/FreeRTOS that keeps a table of descriptors and tags for active allocations.

License

Notifications You must be signed in to change notification settings

gsuberland/arduino-tagged-allocator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Arduino Tagged Allocator

A memory allocator wrapper for Arduino/FreeRTOS that keeps a table of descriptors and tags for active allocations, similar to ExAllocatePoolWithTag in the Windows kernel.

TaggedAlloc::Init();
SomeType* obj = TaggedAlloc::Allocate<SomeType>("abcd");
float* array = TaggedAlloc::AllocateArray<float>(32, "FlAr");
size_t numberOfActiveAllocations = TaggedAlloc::GetAllocationCount();
size_t sizeOfAllocations = TaggedAlloc::GetTotalSize();
TaggedAlloc::PrintStats();
TaggedAlloc::Free(obj);
TaggedAlloc::Free(array);

Example stats output:

*** TAGGED ALLOCATION STATS ***
> Capturing allocation table...
Allocation count: 2
Table size: 64 (1024 bytes)
Tag: abcd, Size: 12, Time: 0.0, Pointer: 0x23450
Tag: FlAr, Size: 512, Time: 0.0, Pointer: 0x23460

About

A memory allocator wrapper for Arduino/FreeRTOS that keeps a table of descriptors and tags for active allocations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages