| Commit message (Collapse) | Author | Age | Files | Lines |
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
ChangeLog
include/jemalloc/internal/chunk.h
src/chunk.c
src/huge.c
src/jemalloc.c
test/rallocm.c
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| | |
Avoid mutex operations in _malloc_{pre,post}fork() unless jemalloc has
been initialized.
Reported by David Xu.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | | |
|
| | |
| |
| |
| |
| | |
Refactor duplicated arena_run_alloc() code into
arena_run_alloc_helper().
|
| | | |
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| | |
It doesn't allow the je_malloc_message and je_malloc_conf symbols to be
overridden when linking statically.
|
| | |
| |
| |
| |
| |
| | |
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 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.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 due to chunk_recycle() calling back into
the base allocator.
|
| | |
| |
| |
| | |
In the alloca() case, this fails to be the right size.
|
| | |
| |
| |
| |
| | |
We don't use MSVC's printf, but ours, and it doesn't support the I32 and I64
prefixes.
|
| | | |
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 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).
|
| | |
| |
| |
| |
| | |
VALGRIND_RESIZEINPLACE_BLOCK was added in valgrind 3.7. Unfortunately, the
__VALGRIND_MINOR__ macro still says 6 in 3.7 :(
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
Make malloc_write() non-inline, in order to resolve its dependency on
je_malloc_write().
|
| | |
| |
| |
| |
| |
| |
| | |
Make CACHELINE a raw constant in order to work around a
__declspec(align()) limitation.
Submitted by Mike Hommey.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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).
|
| | |
| |
| |
| | |
Tested with MSVC 8 32 and 64 bits.
|
| | |
| |
| |
| | |
http://code.google.com/p/msinttypes/
|
| | |
| |
| |
| |
| |
| | |
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).
|
| | |
| |
| |
| |
| |
| | |
- 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.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| | |
Windows headers define a VOID macro.
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| | | |
|
| | |
| |
| |
| |
| | |
Handle prof_tdata resurrection during thread shutdown, similarly to how
tcache and quarantine handle resurrection.
|
| | |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| | |
Reported by Daichi GOTO.
|
| | |
| |
| |
| |
| | |
Fix a PROF_ALLOC_PREP() error path to initialize the return value to
NULL.
|
| | |
| |
| |
| |
| | |
Fix the "epoch" mallctl to update cached stats even if the passed in
epoch is 0.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
Handle quarantine resurrection during thread exit in much the same way
as tcache resurrection is handled.
|
| | | |
|
| | |
| |
| |
| |
| | |
Fix ctl to correctly compute the number of children at each level of the
ctl tree.
|
| | |
| |
| |
| |
| | |
Don't link tests with libraries that only libjemalloc needs to be linked
to.
|
| | | |
|
| | | |
|
| | | |
|
| | |
| |
| |
| |
| | |
Fix jemalloc.sh code generation by adding @sorev@ and using it instead
of @SOREV@ (which contains Makefile-specific variables).
|
| | |
| |
| |
| |
| |
| |
| | |
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.
|