| 43 | // ---------------------------------------------------------------------- |
| 44 | |
| 45 | Arena::Arena(const size_t block_size) |
| 46 | : remaining_(0), |
| 47 | block_size_(block_size), |
| 48 | freestart_(nullptr), // set for real in Reset() |
| 49 | blocks_alloced_(1), |
| 50 | overflow_blocks_(nullptr) { |
| 51 | assert(block_size > kDefaultAlignment); |
| 52 | |
| 53 | first_blocks_[0].mem = |
| 54 | reinterpret_cast<char*>(port::AlignedMalloc(block_size_, sizeof(void*))); |
| 55 | |
| 56 | first_blocks_[0].size = block_size_; |
| 57 | |
| 58 | Reset(); |
| 59 | } |
| 60 | |
| 61 | Arena::~Arena() { |
| 62 | FreeBlocks(); |
nothing calls this directly
no test coverage detected