| 115 | #endif |
| 116 | |
| 117 | template <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. |
| 133 | template <typename T> class allocator { |
nothing calls this directly
no test coverage detected