39 [[nodiscard]]
double *
allocate(std::size_t num_doubles) {
41 throw std::bad_alloc();
Fixed-capacity scratch buffer of doubles with pointer-bump allocation.
std::size_t capacity() const
Total size of the buffer, in doubles.
double * allocate(std::size_t num_doubles)
Reserves the next num_doubles doubles of the buffer.
std::size_t used() const
Doubles handed out since construction or the last reset().
void reset()
Makes the whole buffer available again. Contents are kept, and every slice handed out before becomes ...
std::size_t offset_
index of the next free double in buffer_
BumpAllocator(std::size_t capacity_doubles)
std::vector< double > buffer_