Convert thread-specific caching from magazines, and implement incremental GC.

Add the 'G'/'g' and 'H'/'h' MALLOC_OPTIONS flags.

Add the malloc_tcache_flush() function.

Disable thread-specific caching until the application goes multi-threaded.
This commit is contained in:
Jason Evans
2009-12-29 00:09:15 -08:00
parent b2378168a4
commit 84cbbcb90a
8 changed files with 861 additions and 435 deletions

View File

@@ -46,10 +46,10 @@ any of the following arguments (not a definitive list) to 'configure':
practice it never causes any problems if, for example, 4-byte allocations
are 4-byte-aligned.
--disable-mag
Disable thread-specific caches for sub-page-sized objects. Objects are
cached and released in bulk using "magazines" -- a term coined by the
developers of Solaris's umem allocator.
--disable-tcache
Disable thread-specific caches for small and medium objects. Objects are
cached and released in bulk, thus reducing the total number of mutex
operations. Use the 'H' and 'G' options to control thread-specific caching.
--enable-dss
Enable support for page allocation/deallocation via sbrk(2), in addition to
@@ -82,7 +82,7 @@ any of the following arguments (not a definitive list) to 'configure':
switches from single-threaded to multi-threaded mode, so that it can avoid
mutex locking/unlocking operations while in single-threaded mode. In
practice, this feature usually has little impact on performance unless
magazines are disabled.
thread-specific caching is disabled.
The following environment variables (not a definitive list) impact configure's
behavior: