diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-08-30 07:50:17 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-08-30 07:50:17 +0000 |
commit | 9045702831d62d1a0a693389bfa397b9ca151d8f (patch) | |
tree | e032a4d5336093ded35fa005cd0675b42fdbd2b6 /vespalib | |
parent | 07148b95b3c92c70aeb417a8944770b9307e8036 (diff) |
Use vespalib::SmartBuffer instead of ancient RawBuf.
Diffstat (limited to 'vespalib')
-rw-r--r-- | vespalib/src/vespa/vespalib/data/smart_buffer.cpp | 3 | ||||
-rw-r--r-- | vespalib/src/vespa/vespalib/data/smart_buffer.h | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/vespalib/src/vespa/vespalib/data/smart_buffer.cpp b/vespalib/src/vespa/vespalib/data/smart_buffer.cpp index de079261d6d..8b7bed62ac5 100644 --- a/vespalib/src/vespa/vespalib/data/smart_buffer.cpp +++ b/vespalib/src/vespa/vespalib/data/smart_buffer.cpp @@ -32,8 +32,7 @@ SmartBuffer::drop() { alloc::Alloc empty_buf; _data.swap(empty_buf); - _read_pos = 0; - _write_pos = 0; + reset(); } SmartBuffer::SmartBuffer(size_t initial_size) diff --git a/vespalib/src/vespa/vespalib/data/smart_buffer.h b/vespalib/src/vespa/vespalib/data/smart_buffer.h index eb817e71bbf..17fb7614f0e 100644 --- a/vespalib/src/vespa/vespalib/data/smart_buffer.h +++ b/vespalib/src/vespa/vespalib/data/smart_buffer.h @@ -39,6 +39,10 @@ public: drop(); } } + void reset() { + _read_pos = 0; + _write_pos = 0; + } Memory obtain() override; Input &evict(size_t bytes) override; WritableMemory reserve(size_t bytes) override; |