Test buffer

This commit is contained in:
Victor Zverovich
2014-10-01 08:12:10 -07:00
parent 74dc571ba0
commit 8b9a6e03f6
3 changed files with 108 additions and 80 deletions
+3 -2
View File
@@ -306,13 +306,14 @@ class MemoryBuffer : private Allocator, public Buffer<T> {
private:
T data_[SIZE];
void grow(std::size_t size);
// Free memory allocated by the buffer.
void free() {
if (this->ptr_ != data_) this->deallocate(this->ptr_, this->capacity_);
}
protected:
void grow(std::size_t size);
public:
explicit MemoryBuffer(const Allocator &alloc = Allocator())
: Allocator(alloc), Buffer<T>(data_, SIZE) {}