[#BloombergLP-bdlsb-MemOutStreamBuf_Util-computeNewCapacity] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlsb.adoc[bdlsb]::xref:BloombergLP/bdlsb/MemOutStreamBuf_Util.adoc[MemOutStreamBuf_Util]::computeNewCapacity :relfileprefix: ../../../ :mrdocs: Return a suitable capacity for the specified length and capacity. == Synopsis Declared in `<bdlsb_memoutstreambuf.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- static std::size_t computeNewCapacity( std::size_t newLength, std::size_t currentCapacity); ---- == Description Return the capacity to be used to contain data having the specified `newLength` when the current capacity is the specified `currentCapacity`. The returned value may be larger than `newLength` to allow for growth without the need for reallocation. == Return Value capacity suitable for `newLength` given `currentCapacity` == Parameters [cols="1,4"] |=== | Name| Description | *newLength* | desired data length in characters | *currentCapacity* | current buffer capacity in characters |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#