Make 8-byte tiny size class non-optional.

When tiny size class support was first added, it was intended to support
truly tiny size classes (even 2 bytes).  However, this wasn't very
useful in practice, so the minimum tiny size class has been limited to
sizeof(void *) for a long time now.  This is too small to be standards
compliant, but other commonly used malloc implementations do not even
bother using a 16-byte quantum  on systems with vector units (SSE2+,
AltiVEC, etc.).  As such, it is safe in practice to support an 8-byte
tiny size class on 64-bit systems that support 16-byte types.
This commit is contained in:
Jason Evans
2012-02-13 14:30:52 -08:00
parent 0fee70d718
commit ef8897b4b9
8 changed files with 44 additions and 145 deletions

View File

@@ -455,13 +455,12 @@ for (i = 0; i < nbins; i++) {
allocations in constant time.</para>
<para>Small objects are managed in groups by page runs. Each run maintains
a frontier and free list to track which regions are in use. Unless
<option>--disable-tiny</option> is specified during configuration,
allocation requests that are no more than half the quantum (8 or 16,
depending on architecture) are rounded up to the nearest power of two that
is at least <code language="C">sizeof(<type>void *</type>)</code>.
Allocation requests that are more than half the quantum, but no more than
the minimum cacheline-multiple size class (see the <link
a frontier and free list to track which regions are in use. Allocation
requests that are no more than half the quantum (8 or 16, depending on
architecture) are rounded up to the nearest power of two that is at least
<code language="C">sizeof(<type>void *</type>)</code>. Allocation requests
that are more than half the quantum, but no more than the minimum
cacheline-multiple size class (see the <link
linkend="opt.lg_qspace_max"><mallctl>opt.lg_qspace_max</mallctl></link>
option) are rounded up to the nearest multiple of the quantum. Allocation
requests that are more than the minimum cacheline-multiple size class, but
@@ -680,16 +679,6 @@ for (i = 0; i < nbins; i++) {
during build configuration.</para></listitem>
</varlistentry>
<varlistentry>
<term>
<mallctl>config.tiny</mallctl>
(<type>bool</type>)
<literal>r-</literal>
</term>
<listitem><para><option>--disable-tiny</option> was not specified
during build configuration.</para></listitem>
</varlistentry>
<varlistentry>
<term>
<mallctl>config.tls</mallctl>