From ee4b96187bf0808f7dfe93d5451ecfe1a56a3d98 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 18 Dec 2008 15:24:00 -0800 Subject: [PATCH] buffer: optionally preallocate some append_buffer --- src/include/buffer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/include/buffer.h b/src/include/buffer.h index 7beba30eacf28..57d2d6cc3ec44 100644 --- a/src/include/buffer.h +++ b/src/include/buffer.h @@ -587,13 +587,13 @@ public: public: // cons/des list() : _len(0), last_p(this) {} - list(const list& other) : _buffers(other._buffers), _len(other._len), last_p(this) { } - list(unsigned l) : _len(0), last_p(this) { - ptr bp(l); - push_back(bp); + list(unsigned prealloc) : _len(0), last_p(this) { + append_buffer = buffer::create(prealloc); + append_buffer.set_length(0); // unused, so far. } ~list() {} + list(const list& other) : _buffers(other._buffers), _len(other._len), last_p(this) { } list& operator= (const list& other) { _buffers = other._buffers; _len = other._len; -- 2.39.5