From d6742bfbd3ecadd2bde38ccbb2351bd5c19ede1d Mon Sep 17 00:00:00 2001 From: Jason Evans Date: Wed, 27 Aug 2008 02:00:53 +0000 Subject: Add thread-specific caching for small size classes, based on magazines. This caching allows for completely lock-free allocation/deallocation in the steady state, at the expense of likely increased memory use and fragmentation. Reduce the default number of arenas to 2*ncpus, since thread-specific caching typically reduces arena contention. Modify size class spacing to include ranges of 2^n-spaced, quantum-spaced, cacheline-spaced, and subpage-spaced size classes. The advantages are: fewer size classes, reduced false cacheline sharing, and reduced internal fragmentation for allocations that are slightly over 512, 1024, etc. Increase RUN_MAX_SMALL, in order to limit fragmentation for the subpage-spaced size classes. Add a size-->bin lookup table for small sizes to simplify translating sizes to size classes. Include a hard-coded constant table that is used unless custom size class spacing is specified at run time. Add the ability to disable tiny size classes at compile time via MALLOC_TINY. --- lib/libc/include/libc_private.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/libc/include') diff --git a/lib/libc/include/libc_private.h b/lib/libc/include/libc_private.h index 70e1ef81014c..50903f3c74fa 100644 --- a/lib/libc/include/libc_private.h +++ b/lib/libc/include/libc_private.h @@ -157,6 +157,12 @@ void _set_tp(void *tp); */ extern const char *__progname; +/* + * This function is used by the threading libraries to notify malloc that a + * thread is exiting. + */ +void _malloc_thread_cleanup(void); + /* * These functions are used by the threading libraries in order to protect * malloc across fork(). -- cgit v1.3