absl::CordBuffer::MaximumPayload

MaximumPayload overloads

Synopses

Declared in <absl/strings/cord_buffer.h>

Returns the guaranteed maximum payload for a CordBuffer returned by the CreateWithDefaultLimit() method. While small, each internal buffer inside a Cord incurs an overhead to manage the length, type and reference count for the buffer managed inside the cord tree. Applications can use this method to get approximate number of buffers required for a given byte size, etc.

constexpr
static
size_t
MaximumPayload();
» more...

Overload to the above MaximumPayload() except that it returns the maximum payload for a CordBuffer returned by the CreateWithCustomLimit() method given the provided block_size.

constexpr
static
size_t
MaximumPayload(size_t block_size);
» more...

Return Value

  • The maximum payload for a default-limit CordBuffer.
  • The maximum payload for the given block size.

Parameters

NameDescription
block_sizeThe block size of the custom-limit CordBuffer.