| 138 | } |
| 139 | |
| 140 | void shrinkToFit(Allocator* allocator) { |
| 141 | if (count_ > 0) |
| 142 | pools_[count_ - 1].shrinkToFit(allocator); |
| 143 | if (pools_ != preallocatedPools_ && count_ != capacity_) { |
| 144 | pools_ = static_cast<Pool*>( |
| 145 | allocator->reallocate(pools_, count_ * sizeof(Pool))); |
| 146 | ARDUINOJSON_ASSERT(pools_ != nullptr); // realloc to smaller can't fail |
| 147 | capacity_ = count_; |
| 148 | } |
| 149 | } |
| 150 | |
| 151 | private: |
| 152 | Slot<T> allocFromFreeList() { |
nothing calls this directly
no test coverage detected