summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'dev'3.0.0Jason Evans2012-05-1274-8056/+10840
|\ | | | | | | | | | | | | | | | | | | Conflicts: ChangeLog include/jemalloc/internal/chunk.h src/chunk.c src/huge.c src/jemalloc.c test/rallocm.c
| * Update ChangeLog for 3.0.0.Jason Evans2012-05-121-4/+6
| |
| * Return early in _malloc_{pre,post}fork() if uninitialized.Jason Evans2012-05-121-0/+14
| | | | | | | | | | | | | | Avoid mutex operations in _malloc_{pre,post}fork() unless jemalloc has been initialized. Reported by David Xu.
| * Fix large calloc() zeroing bugs.Jason Evans2012-05-113-30/+29
| | | | | | | | | | | | | | | | | | Refactor code such that arena_mapbits_{large,small}_set() always preserves the unzeroed flag, and manually manipulate the unzeroed flag in the one case where it actually gets reset (in arena_chunk_purge()). This fixes unzeroed preservation bugs in arena_run_split() and arena_ralloc_large_grow(). These bugs caused large calloc() to return non-zeroed memory under some circumstances.
| * Add arena chunk map assertions.Jason Evans2012-05-111-15/+30
| |
| * Refactor arena_run_alloc().Jason Evans2012-05-111-34/+24
| | | | | | | | | | Refactor duplicated arena_run_alloc() code into arena_run_alloc_helper().
| * Update a comment.Jason Evans2012-05-101-9/+9
| |
| * Generalize "stats.mapped" documentation.Jason Evans2012-05-101-2/+2
| | | | | | | | | | | | Generalize "stats.mapped" documentation to state that all inactive chunks are omitted, now that it is possible for mmap'ed chunks to be omitted in addition to DSS chunks.
| * Export je_memalign and je_vallocMike Hommey2012-05-091-0/+9
| | | | | | | | | | | | da99e31 removed attributes on je_memalign and je_valloc, while they didn't have a definition in the jemalloc.h header, thus making them non-exported. Export them again, by defining them in the jemalloc.h header.
| * Remove -fno-common compiler flag for OS X.Mike Hommey2012-05-091-1/+1
| | | | | | | | | | It doesn't allow the je_malloc_message and je_malloc_conf symbols to be overridden when linking statically.
| * Add the --enable-mremap option.Jason Evans2012-05-097-17/+64
| | | | | | | | | | | | Add the --enable-mremap option, and disable the use of mremap(2) by default, for the same reason that freeing chunks via munmap(2) is disabled by default on Linux: semi-permanent VM map fragmentation.
| * Fix chunk_recycle() to stop leaking trailing chunks.Jason Evans2012-05-091-40/+38
| | | | | | | | | | | | | | Fix chunk_recycle() to correctly compute trailsize and re-insert trailing chunks. This fixes a major virtual memory leak. Simplify chunk_record() to avoid dropping/re-acquiring chunks_mtx.
| * Fix chunk_alloc_mmap() bugs.Jason Evans2012-05-092-35/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Simplify chunk_alloc_mmap() to no longer attempt map extension. The extra complexity isn't warranted, because although in the success case it saves one system call as compared to immediately falling back to chunk_alloc_mmap_slow(), it also makes the failure case even more expensive. This simplification removes two bugs: - For Windows platforms, pages_unmap() wasn't being called for unaligned mappings prior to falling back to chunk_alloc_mmap_slow(). This caused permanent virtual memory leaks. - For non-Windows platforms, alignment greater than chunksize caused pages_map() to be called with size 0 when attempting map extension. This always resulted in an mmap() error, and subsequent fallback to chunk_alloc_mmap_slow().
| * Fix a base allocator deadlock.Jason Evans2012-05-031-3/+14
| | | | | | | | | | Fix a base allocator deadlock due to chunk_recycle() calling back into the base allocator.
| * Don't use sizeof() on a VARIABLE_ARRAYMike Hommey2012-05-021-2/+2
| | | | | | | | In the alloca() case, this fails to be the right size.
| * Use "standard" printf prefixes instead of MSVC ones in inttypes.hMike Hommey2012-05-021-51/+59
| | | | | | | | | | We don't use MSVC's printf, but ours, and it doesn't support the I32 and I64 prefixes.
| * Use "hardcoded" dependencies when compiler doesn't support -MMMike Hommey2012-05-022-0/+17
| |
| * Allow je_malloc_message to be overridden when linking staticallyMike Hommey2012-05-022-19/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | If an application wants to override je_malloc_message, it is better to define the symbol locally than to change its value in main(), which might be too late for various reasons. Due to je_malloc_message being initialized in util.c, statically linking jemalloc with an application defining je_malloc_message fails due to "multiple definition of" the symbol. Defining it without a value (like je_malloc_conf) makes it more easily overridable.
| * Further optimize and harden arena_salloc().Jason Evans2012-05-023-38/+74
| | | | | | | | | | | | | | | | | | Further optimize arena_salloc() to only look at the binind chunk map bits in the common case. Add more sanity checks to arena_salloc() that detect chunk map inconsistencies for large allocations (whether due to allocator bugs or application bugs).
| * Check for VALGRIND_RESIZEINPLACE_BLOCK supportMike Hommey2012-05-021-4/+1
| | | | | | | | | | VALGRIND_RESIZEINPLACE_BLOCK was added in valgrind 3.7. Unfortunately, the __VALGRIND_MINOR__ macro still says 6 in 3.7 :(
| * Fix partial rename of s/EXPORT/JEMALLOC_EXPORT/g.Jason Evans2012-05-021-5/+5
| |
| * Update private namespace mangling.Jason Evans2012-05-021-12/+11
| |
| * Make malloc_write() non-inline.Jason Evans2012-05-022-11/+12
| | | | | | | | | | Make malloc_write() non-inline, in order to resolve its dependency on je_malloc_write().
| * Make CACHELINE a raw constant.Jason Evans2012-05-021-1/+4
| | | | | | | | | | | | | | Make CACHELINE a raw constant in order to work around a __declspec(align()) limitation. Submitted by Mike Hommey.
| * Optimize malloc() and free() fast paths.Jason Evans2012-05-027-388/+614
| | | | | | | | | | | | | | | | | | | | Embed the bin index for small page runs into the chunk page map, in order to omit [...] in the following dependent load sequence: ptr-->mapelm-->[run-->bin-->]bin_info Move various non-critcal code out of the inlined function chain into helper functions (tcache_event_hard(), arena_dalloc_small(), and locking).
| * Add support for MSVCMike Hommey2012-05-0111-15/+177
| | | | | | | | Tested with MSVC 8 32 and 64 bits.
| * Import msinttypesMike Hommey2012-05-012-0/+552
| | | | | | | | http://code.google.com/p/msinttypes/
| * Replace JEMALLOC_ATTR with various different macros when it makes senseMike Hommey2012-05-018-82/+56
| | | | | | | | | | | | Theses newly added macros will be used to implement the equivalent under MSVC. Also, move the definitions to headers, where they make more sense, and for some, are even more useful there (e.g. malloc).
| * Few configure.ac adjustmentsMike Hommey2012-05-013-15/+9
| | | | | | | | | | | | - Use the extensions autoconf finds for object and executable files. - Remove the sorev variable, and replace SOREV definition with sorev's. - Default to je_ prefix on win32.
| * Use Get/SetLastError on Win32Mike Hommey2012-04-307-33/+71
| | | | | | | | | | | | | | | | | | Using errno on win32 doesn't quite work, because the value set in a shared library can't be read from e.g. an executable calling the function setting errno. At the same time, since buferror always uses errno/GetLastError, don't pass it.
| * Remove the VOID macroMike Hommey2012-04-301-6/+2
| | | | | | | | Windows headers define a VOID macro.
| * Avoid variable length arrays and remove declarations within codeMike Hommey2012-04-297-18/+43
| | | | | | | | | | | | | | | | | | | | | | | | MSVC doesn't support C99, and building as C++ to be able to use them is dangerous, as C++ and C99 are incompatible. Introduce a VARIABLE_ARRAY macro that either uses VLA when supported, or alloca() otherwise. Note that using alloca() inside loops doesn't quite work like VLAs, thus the use of VARIABLE_ARRAY there is discouraged. It might be worth investigating ways to check whether VARIABLE_ARRAY is used in such context at runtime in debug builds and bail out if that happens.
| * Fix more prof_tdata resurrection corner cases.Jason Evans2012-04-292-7/+9
| |
| * Handle prof_tdata resurrection.Jason Evans2012-04-292-20/+52
| | | | | | | | | | Handle prof_tdata resurrection during thread shutdown, similarly to how tcache and quarantine handle resurrection.
| * Don't set prof_tdata during thread cleanup.Jason Evans2012-04-281-3/+0
| | | | | | | | | | | | Don't set prof_tdata during thread cleanup, because doing so will cause the cleanup function to be called again, the second time with a NULL argument.
| * Fix Valgrind URL in documentation.Jason Evans2012-04-261-20/+20
| | | | | | | | Reported by Daichi GOTO.
| * Fix a PROF_ALLOC_PREP() error path.Jason Evans2012-04-252-3/+7
| | | | | | | | | | Fix a PROF_ALLOC_PREP() error path to initialize the return value to NULL.
| * Fix the "epoch" mallctl.Jason Evans2012-04-252-12/+13
| | | | | | | | | | Fix the "epoch" mallctl to update cached stats even if the passed in epoch is 0.
| * Add missing Valgrind annotations.Jason Evans2012-04-242-0/+4
| |
| * Fix quarantine_grow() bugs.Jason Evans2012-04-241-9/+8
| |
| * Add usize sanity checking to quarantine.Jason Evans2012-04-241-13/+21
| |
| * Handle quarantine resurrection during thread exit.Jason Evans2012-04-241-5/+45
| | | | | | | | | | Handle quarantine resurrection during thread exit in much the same way as tcache resurrection is handled.
| * Fix two CHILD() macro calls in the ctl tree.Jason Evans2012-04-241-2/+2
| |
| * Fix ctl regression.Jason Evans2012-04-242-30/+32
| | | | | | | | | | Fix ctl to correctly compute the number of children at each level of the ctl tree.
| * Don't link tests with superfluous libraries.Jason Evans2012-04-241-1/+1
| | | | | | | | | | Don't link tests with libraries that only libjemalloc needs to be linked to.
| * Silence compiler warnings.Jason Evans2012-04-231-3/+3
| |
| * Force use of TLS if heap profiling is enabled.Jason Evans2012-04-231-0/+4
| |
| * Clean up documentation and formatting.Jason Evans2012-04-234-15/+11
| |
| * Fix jemalloc.sh code generation.Jason Evans2012-04-232-1/+5
| | | | | | | | | | Fix jemalloc.sh code generation by adding @sorev@ and using it instead of @SOREV@ (which contains Makefile-specific variables).
| * Avoid using a union for ctl_node_sMike Hommey2012-04-232-81/+114
| | | | | | | | | | | | | | MSVC doesn't support C99, and as such doesn't support designated initialization of structs and unions. As there is never a mix of indexed and named nodes, it is pretty straightforward to use a different type for each.