diff options
author | Lee Clagett <code@leeclagett.com> | 2020-08-17 16:20:09 -0400 |
---|---|---|
committer | Lee Clagett <code@leeclagett.com> | 2020-08-17 21:30:34 -0400 |
commit | b641e0a2c0f70227a526cfafd4977c87f724a6da (patch) | |
tree | a56688591a79b99ab717d9ef06c48b97678d6374 /contrib | |
parent | Revert "Use domain-separated ChaCha20 for in-memory key encryption" (diff) | |
download | monero-b641e0a2c0f70227a526cfafd4977c87f724a6da.tar.xz |
Add clear method to byte_stream
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/epee/include/byte_stream.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/epee/include/byte_stream.h b/contrib/epee/include/byte_stream.h index 98f563ca9..42a9e1dd9 100644 --- a/contrib/epee/include/byte_stream.h +++ b/contrib/epee/include/byte_stream.h @@ -117,6 +117,9 @@ namespace epee check(more); } + //! Reset write position, but do not release internal memory. \post `size() == 0`. + void clear() noexcept { next_write_ = buffer_.get(); } + /*! Copy `length` bytes starting at `ptr` to end of stream. \throw std::range_error If exceeding max size_t value. \throw std::bad_alloc If allocation fails. */ |