aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConstantin Michael <constantin@codesynthesis.com>2011-10-14 14:40:39 +0200
committerConstantin Michael <constantin@codesynthesis.com>2011-10-21 11:47:10 +0200
commit6ec222043142135dabb57e8012613c64570e64d4 (patch)
tree80ac52678ae09e7210b69628e144c178fb3cc87e
parent5fef0b52664ff59e70ba6ef18fe8a602b631a57f (diff)
Allow specification of buffer capacity on construction defaulting to 256 bytes
-rw-r--r--odb/details/buffer.hxx9
1 files 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 ()
{