Commit Graph

1430 Commits

Author SHA1 Message Date
Jason Evans
e888879e9c Implement per size class stats collection for large objects. 2009-12-29 00:09:15 -08:00
Jason Evans
45c128d1a9 Base maximum dirty page count on proportion of active memory.
Add dirty page tracking for pages within active small/medium object runs.

Reduce chunks_dirty red-black tree operations via lazy updating.
2009-12-29 00:09:15 -08:00
Jason Evans
6c8b13bf43 Update description of --with-rpath. 2009-12-29 00:09:15 -08:00
Jason Evans
94ad2b57c3 Use "lg" prefix rather than "2pow" suffix to indicate base 2 logarithms.
Remove the default definition for SIZEOF_INT_2POW.
2009-12-29 00:09:15 -08:00
Jason Evans
d64d4448cd Modify pthread_create() wrapper such that isthreaded is only set once. 2009-12-29 00:09:15 -08:00
Jason Evans
f251814779 Handle 0-size allocation requests in posix_memalign(). 2009-12-29 00:09:15 -08:00
Jason Evans
84cbbcb90a 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.
2009-12-29 00:09:15 -08:00
Jason Evans
b2378168a4 Add support for medium size classes, [4KiB..32KiB], 2KiB apart by default.
Add the 'M' and 'm' MALLOC_OPTIONS flags, which control the maximum medium size
class.

Relax the cap on small/medium run size to arena_maxclass.

Reduce arena_run_reg_dalloc() integer division code complexity.

Increase the default chunk size from 1MiB to 4MiB.
2009-12-29 00:09:15 -08:00
Jason Evans
6d7bb5357a Remove opt_dss and opt_mmap, such that if DSS allocation is enabled, both DSS
and heap allocation are always enabled.
2009-12-29 00:09:15 -08:00
Jason Evans
5463a5298d Streamline the fast path for magazine-based allocation/deallocation. 2009-12-29 00:09:15 -08:00
Jason Evans
3ee7a5c5b0 Remove the dynamic rebalancing code, since magazines reduce its utility. 2009-12-29 00:09:15 -08:00
Jason Evans
569432cffd Implement thread-aware allocation event tracing. 2009-12-29 00:09:15 -08:00
Jason Evans
90895cf859 Add --with-jemalloc-prefix, which supports API mangling.
Rename jemalloc_options-->malloc_options and jemalloc_message-->malloc_message.
2009-12-29 00:09:15 -08:00
Jason Evans
bca042dfeb Use __restrict rather than restrict. 2009-12-29 00:09:15 -08:00
Jason Evans
87704ea339 Make sure that there are no more than 256 size clases, since size2bin can only
encode bin indices in [0..255].
2009-11-12 17:57:57 -08:00
Jason Evans
1517cc6df7 Integrate architecture portability fixes.
Submitted by:	Ingvar Hagelund
2009-11-09 15:25:02 -08:00
Jason Evans
a162402282 Fix configure docs (--enable-lazy-lock --> --disable-lazy-lock).
Fix some style nits.

Ignore the jemalloc/bin directory.
2009-11-09 14:58:12 -08:00
Jason Evans
d3068c3f46 _pt_thread_death_internal(), which is part of Linux's nptl pthreads
implementation, calls free() after calling TSD destructors.  This was causing a
crash during thread exit, since the magazine rack was no longer valid for the
thread.  Fix this by using a special mag_rack value to indicate that
deallocation should bypass the magazine machinery.
2009-11-09 14:58:12 -08:00
Jason Evans
6f89d4b806 Modify chunk_alloc_mmap() to support address space layout randomization (ASLR). 2009-11-09 14:58:12 -08:00
Jason Evans
a25d0a8a72 Update assertions in realloc() and free() to allow for deallocation during
initializtion.
2009-11-09 14:57:38 -08:00
Jason Evans
662a017c1d Integrate mtrgraph and mtrplay. 2009-07-01 19:24:31 -07:00
Jason Evans
f3340ca8d5 Add configure tests for CFLAGS settings.
Add configure test for __asm__ syntax.

Add configure test for __attribute__ syntax.
2009-06-30 16:17:05 -07:00
Jason Evans
b8f0a65173 Fix various compiler warnings.
Reported by:	Mark Rabkin
2009-06-29 09:41:43 -07:00
Jason Evans
a9b0125e97 Minor documentation and comment cleanups. 2009-06-26 16:34:13 -07:00
Jason Evans
cc00a15770 Clean up the manpage and conditionalize various portions according to how
jemalloc is configured.

Modify arena_malloc() API to avoid unnecessary choose_arena() calls.  Remove
unnecessary code from choose_arena().

Enable lazy-lock by default, now that choose_arena() is both faster and out of
the critical path.

Implement objdir support in the build system.
2009-06-25 18:06:48 -07:00
Jason Evans
b7924f50c0 Implement configuration system.
Implement minimal Makefile.

Make compile-time-optional jemalloc features controllable via configure
options (debug, stats, tiny, mag, balance, dss).

Conditionally exclude most of the opt_* run-time options, based on configure
options (fill, xmalloc, sysv).

Implement optional --enable-dynamic-page-shift.

Implement optional --enable-lazy-lock.

Re-order malloc_init_hard() and use the malloc_initializer variable to support
recursive allocation in malloc_ncpus().

Add mag_rack_tsd in order to receive notifications of thread termination.

Add jemalloc.h.
2009-06-23 19:01:18 -07:00
Jason Evans
4450b830b6 Merge FreeBSD's malloc(3) and posix_memalign(3) manpages to create jemalloc(3). 2009-06-22 17:44:39 -07:00
Jason Evans
804c9ec3af Fix various namespace issues. 2009-06-22 17:44:33 -07:00
Jason Evans
c9658dd35c Merge code from the original jemalloc_linux port. 2009-06-22 14:44:08 -07:00
Jason Evans
289053c95b Import pristine FreeBSD sources. 2009-06-22 12:08:42 -07:00