| 907 | : ResizableBuffer(nullptr, 0, std::move(mm)), pool_(pool), alignment_(alignment) {} |
| 908 | |
| 909 | ~PoolBuffer() override { |
| 910 | // Avoid calling pool_->Free if the global pools are destroyed |
| 911 | // (XXX this will not work with user-defined pools) |
| 912 | |
| 913 | // This can happen if a Future is destructing on one thread while or |
| 914 | // after memory pools are destructed on the main thread (as there is |
| 915 | // no guarantee of destructor order between thread/memory pools) |
| 916 | uint8_t* ptr = mutable_data(); |
| 917 | if (ptr && !global_state.is_finalizing()) { |
| 918 | pool_->Free(ptr, capacity_, alignment_); |
| 919 | } |
| 920 | } |
| 921 | |
| 922 | Status Reserve(const int64_t capacity) override { |
| 923 | if (capacity < 0) { |
nothing calls this directly
no test coverage detected