Buffers have a feature table.

Closes #891
This commit is contained in:
Klemens
2022-10-04 14:37:26 +08:00
committed by Klemens Morgenstern
parent 3869d472ec
commit 2820d256e8
2 changed files with 27 additions and 3 deletions

View File

@ -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.

View File

@ -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.