| 478 | |
| 479 | template <typename T> |
| 480 | Buffer<T>::~Buffer() { |
| 481 | if (data()) { |
| 482 | if (LogMemory::IsEnabled()) { |
| 483 | RecordDeallocation(); |
| 484 | } |
| 485 | TypedAllocator::Deallocate<T>(alloc_, static_cast<T*>(data()), elem_); |
| 486 | } |
| 487 | } |
| 488 | |
| 489 | // Allocates a T[n] buffer. Fills in the buffer with repeated values |
| 490 | // in "in". If "in" has less values than "n", fills the rest of T[n] |