MCPcopy Create free account
hub / github.com/bblanchon/ArduinoJson / create

Method create

src/ArduinoJson/Memory/MemoryPool.hpp:50–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48class 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_)

Callers 1

addPoolMethod · 0.45

Calls 1

allocateMethod · 0.45

Tested by

no test coverage detected