diff --git a/doc/qbk/03_core/5_buffers.qbk b/doc/qbk/03_core/5_buffers.qbk index c1c19eb4..584ae25f 100644 --- a/doc/qbk/03_core/5_buffers.qbk +++ b/doc/qbk/03_core/5_buffers.qbk @@ -167,6 +167,31 @@ set of additional implementations of the dynamic buffer concept: ]] ] +The buffers provide different guarantees regarding the allocated memory; stable means that existing +mutable and const_buffers obtained by calling `data` or `prepare`, will remain valid. + +Note that copies always requires a new call to `data` and `prepare`.` + +[table Memory stability +[[Name] [Allocation] [buffer sequence length] [Max Size] [Movable] [prepare/commit] [consume]] +[ + [[link beast.ref.boost__beast__flat_buffer `flat_buffer`]] + [dynamic] [1] [dynamic] [yes] [invalidating] [invalidating] +] +[ + [[link beast.ref.boost__beast__multi_buffer `multi_buffer`]] + [dynamic] [dynamic] [stable] [yesy] [invalidating] +] +[ + [[link beast.ref.boost__beast__flat_static_buffer `flat_static_buffer`]] + [static] [1] [static] [no] [invalidating] +] +[ + [[link beast.ref.boost__beast__static_buffer `static_buffer`]] + [static] [1-2] [static] [no] [may invalidate] +] +] + These two functions facilitate buffer interoperability with standard output streams. diff --git a/include/boost/beast/core/static_buffer.hpp b/include/boost/beast/core/static_buffer.hpp index 3325f592..6f8f938c 100644 --- a/include/boost/beast/core/static_buffer.hpp +++ b/include/boost/beast/core/static_buffer.hpp @@ -143,11 +143,10 @@ public: /** Returns a mutable buffer sequence representing writable bytes. Returns a mutable buffer sequence representing the writable - bytes containing exactly `n` bytes of storage. Memory may be - reallocated as needed. + bytes containing exactly `n` bytes of storage. All buffers sequences previously obtained using - @ref data or @ref prepare are invalidated. + @ref data or @ref prepare may be invalidated. @param n The desired number of bytes in the returned buffer sequence.