MCPcopy Create free account
hub / github.com/FastLED/FastLED / PSRamAllocator

Class PSRamAllocator

src/fl/stl/allocator.h:117–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

115#endif
116
117template <typename T> class PSRamAllocator {
118 public:
119 static T *Alloc(fl::size n) FL_NOEXCEPT {
120 void *ptr = PSRamAllocate(sizeof(T) * n, true);
121 return fl::bit_cast_ptr<T>(ptr);
122 }
123
124 static void Free(T *p) FL_NOEXCEPT {
125 if (p == nullptr) {
126 return;
127 }
128 PSRamDeallocate(p);
129 }
130};
131
132// std compatible allocator.
133template <typename T> class allocator {

Callers

nothing calls this directly

Calls 1

PSRamDeallocateFunction · 0.85

Tested by

no test coverage detected