| 62 | const_pointer address(const_reference r) const noexcept { return std::addressof(r); } |
| 63 | |
| 64 | pointer allocate(size_type n, const void* /*hint*/ = NULLPTR) { |
| 65 | uint8_t* data; |
| 66 | Status s = pool_->Allocate(n * sizeof(T), &data); |
| 67 | if (!s.ok()) throw std::bad_alloc(); |
| 68 | return reinterpret_cast<pointer>(data); |
| 69 | } |
| 70 | |
| 71 | void deallocate(pointer p, size_type n) { |
| 72 | pool_->Free(reinterpret_cast<uint8_t*>(p), n * sizeof(T)); |