[#absl-CordBuffer-SetLength]
= xref:absl.adoc[absl]::xref:absl/CordBuffer.adoc[CordBuffer]::SetLength
:relfileprefix: ../../
:mrdocs:

Sets the data length of this instance&period; Applications must make sure all data of the specified length has been initialized before adding a CordBuffer to a Cord&colon; failure to do so will lead to undefined behavior&period; Setting the length to a small value or zero does not release any memory held by this CordBuffer instance&period; Requires `length &lt;&equals; capacity()`&period; Applications should preferably use the `IncreaseLengthBy()` method above in combination with the &apos;available()` or `available&lowbar;up&lowbar;to()&grave; methods&period;

== Synopsis

Declared in `&lt;absl&sol;strings&sol;cord&lowbar;buffer&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
SetLength(size&lowbar;t length);
----

== Parameters

[cols="1,4"]
|===
| Name| Description
| *length*
| The new length of the initialized data&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
