Deque capacity always is power of 2 and can decrease.

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@339769 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
André Luis Ferreira da Silva Bacci 2016-08-02 22:53:08 +00:00
parent 73026aaaf8
commit 929eac47a0

View file

@ -14,10 +14,10 @@
<methodparam><type>int</type><parameter>capacity</parameter></methodparam>
</methodsynopsis>
<para>
Ensures that enough memory is allocated for a required capacity.
This removes the need to reallocate the internal as values are added.
Ensures that enough memory is allocated for a required capacity.
This removes the need to reallocate the internal as values are added.
</para>
</refsect1>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@ -29,10 +29,11 @@
The number of values for which capacity should be allocated.
</para>
<note>
<para>
Capacity will stay the same if this value is less than or equal to the
current capacity.
</para>
<para>
Capacity will always be rounded up to the nearest power of 2.
Capacity will be halved if element count drops below a quarter of
current capacity.
</para>
</note>
</listitem>
</varlistentry>