| 72 | const_pointer address(const_reference r) const noexcept { return std::addressof(r); } |
| 73 | |
| 74 | pointer allocate(size_type n, const void* /*hint*/ = NULLPTR) { |
| 75 | uint8_t* data; |
| 76 | Status s = pool_->Allocate(n * sizeof(T), &data); |
| 77 | if (!s.ok()) throw BadAlloc(std::move(s)); |
| 78 | return reinterpret_cast<pointer>(data); |
| 79 | } |
| 80 | |
| 81 | void deallocate(pointer p, size_type n) { |
| 82 | pool_->Free(reinterpret_cast<uint8_t*>(p), n * sizeof(T)); |