Commit Graph

13 Commits

Author SHA1 Message Date
Jason Evans
e476f8a161 Refactor jemalloc.c into multiple source files.
Fix a stats bug in large object curruns accounting.

Replace tcache_bin_fill() with arena_tcache_fill(), and fix a bug in an OOM
error path.

Fix API name mangling to coexist with __attribute__((malloc)).
2010-01-16 09:53:50 -08:00
Jason Evans
03c2237af3 Make malloc_stats_print() a public symbol, and make it repeatedly callable.
Incrementally merge tcache stats, so that malloc_stats_print() always reports
at least most events that have occurred thus far.
2010-01-03 12:10:42 -08:00
Jason Evans
9ad48230ed Simplify JEMALLOC_ATTR_* macros to become JEMALLOC_ATTR().
Use JEMALLOC_ATTR(tls_model("initial-exec)) instead of -ftls-model=initial-exec
so that libjemalloc_pic.a can be directly linked into another library without
needing linker options changes.

Add attributes to malloc, calloc, and posix_memalign, for compatibility with
glibc's declarations.

Add function prototypes for the standard malloc(3) API.
2010-01-03 11:59:20 -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
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
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
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
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
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