| 48 | class MemoryPool { |
| 49 | public: |
| 50 | void create(SlotCount cap, Allocator* allocator) { |
| 51 | ARDUINOJSON_ASSERT(cap > 0); |
| 52 | slots_ = reinterpret_cast<T*>(allocator->allocate(slotsToBytes(cap))); |
| 53 | capacity_ = slots_ ? cap : 0; |
| 54 | usage_ = 0; |
| 55 | } |
| 56 | |
| 57 | void destroy(Allocator* allocator) { |
| 58 | if (slots_) |