From 6ec222043142135dabb57e8012613c64570e64d4 Mon Sep 17 00:00:00 2001 From: Constantin Michael Date: Fri, 14 Oct 2011 14:40:39 +0200 Subject: Allow specification of buffer capacity on construction defaulting to 256 bytes --- odb/details/buffer.hxx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/odb/details/buffer.hxx b/odb/details/buffer.hxx index 6102c7b..8f0dc83 100644 --- a/odb/details/buffer.hxx +++ b/odb/details/buffer.hxx @@ -26,8 +26,8 @@ namespace odb operator delete (data_); } - basic_buffer_base () - : capacity_ (512) + basic_buffer_base (std::size_t capacity) + : capacity_ (capacity) { data_ = operator new (capacity_); } @@ -51,6 +51,11 @@ namespace odb { public: + basic_buffer (std::size_t capacity = 256) + : basic_buffer_base (capacity) + { + } + T* data () { -- cgit v1.1