From 2216adc013156e61d979b33c45afda33af81bad9 Mon Sep 17 00:00:00 2001 From: Mohammad Nejati Date: Fri, 5 Jan 2024 07:39:44 +0000 Subject: [PATCH] Stronger buffer contract on flat_buffer and flat_static_buffer Fixes #1513 --- include/boost/beast/core/flat_buffer.hpp | 2 +- include/boost/beast/core/flat_static_buffer.hpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/include/boost/beast/core/flat_buffer.hpp b/include/boost/beast/core/flat_buffer.hpp index 550e4414..85115e37 100644 --- a/include/boost/beast/core/flat_buffer.hpp +++ b/include/boost/beast/core/flat_buffer.hpp @@ -43,7 +43,7 @@ namespace beast { @li Buffer sequences representing the readable and writable bytes, returned by @ref data and @ref prepare, will have - length one. + a type of net::const_buffer or net::mutable_buffer. Upon construction, a maximum size for the buffer may be specified. If this limit is exceeded, the `std::length_error` diff --git a/include/boost/beast/core/flat_static_buffer.hpp b/include/boost/beast/core/flat_static_buffer.hpp index 48b378d8..c5cd2fe3 100644 --- a/include/boost/beast/core/flat_static_buffer.hpp +++ b/include/boost/beast/core/flat_static_buffer.hpp @@ -19,7 +19,7 @@ namespace boost { namespace beast { -/** A dynamic buffer using a fixed size internal buffer. +/** A dynamic buffer using a fixed size internal buffer using no memory allocations. A dynamic buffer encapsulates memory storage that may be automatically resized as required, where the memory is @@ -37,7 +37,7 @@ namespace beast { @li Buffer sequences representing the readable and writable bytes, returned by @ref data and @ref prepare, will have - length one. + a type of net::const_buffer or net::mutable_buffer. @li Ownership of the underlying storage belongs to the derived class. @@ -245,11 +245,11 @@ private: //------------------------------------------------------------------------------ -/** A DynamicBuffer with a fixed size internal buffer. +/** A DynamicBuffer with a fixed size internal buffer using no memory allocations. - Buffer sequences returned by @ref data and @ref prepare - will always be of length one. - This implements a dynamic buffer using no memory allocations. + Buffer sequences representing the readable and writable + bytes, returned by @ref data and @ref prepare, will have + a type of net::const_buffer or net::mutable_buffer. @tparam N The number of bytes in the internal buffer.