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