| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
This avoids fork/exec()ing in loops, as echo is a builtin, and makes
size_classes.sh much faster (from > 10s to < 0.2s on mingw on my machine).
|
| |
|
|
|
|
| |
This will allow linking for win32 without pthreads more easily
|
|
|
|
|
| |
It is a linker flag, so it doesn't make sense in CFLAGS, and it's the
default when invoking the linker for shared libraries.
|
|
|
|
|
| |
Start preparing ChangeLog for 3.0.0 release. Additional fixes and
changes are yet to come, so this is not a complete ChangeLog.
|
|
|
|
|
|
| |
Add the --disable-munmap option, remove the configure test that
attempted to detect the VM allocation quirk known to exist on Linux
x86[_64], and make --disable-munmap implicit on Linux.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Add a configure test to determine whether common mmap()/munmap()
patterns cause VM map holes, and only use munmap() to discard unused
chunks if the problem does not exist.
Unify the chunk caching for mmap and dss.
Fix options processing to limit lg_chunk to be large enough that
redzones will always fit.
|
|
|
|
|
|
| |
Always disable redzone by default, even when --enable-debug is
specified. The memory overhead for redzones can be substantial, which
makes this feature something that should only be opted into.
|
| |
|
| |
|
|
|
|
|
| |
test/bitmap.c #includes src/bitmap.c, which is correctly detected by gcc -MM,
but building test/bitmap.o doesn't require src/bitmap.o.
|
|
|
|
|
| |
Chunk_boot0 calls rtree_new, which calls base_alloc, which locks the
base_mtx mutex. That mutex is initialized in base_boot.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Normalize arena_palloc(), chunk_alloc_mmap_slow(), and
chunk_recycle_dss() to use the same algorithm for trimming
over-allocation.
Add the ALIGNMENT_ADDR2BASE(), ALIGNMENT_ADDR2OFFSET(), and
ALIGNMENT_CEILING() macros, and use them where appropriate.
Remove the run_size_p parameter from sa2u().
Fix a potential deadlock in chunk_recycle_dss() that was introduced by
eae269036c9f702d9fa9be497a1a2aa1be13a29e (Add alignment support to
chunk_alloc()).
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement Valgrind support, as well as the redzone and quarantine
features, which help Valgrind detect memory errors. Redzones are only
implemented for small objects because the changes necessary to support
redzones around large and huge objects are complicated by in-place
reallocation, to the point that it isn't clear that the maintenance
burden is worth the incremental improvement to Valgrind support.
Merge arena_salloc() and arena_salloc_demote().
Refactor i[v]salloc() to expose the 'demote' option.
|
|
|
|
|
|
|
| |
Rename labels from FOO to label_foo in order to avoid system macro
definitions, in particular OUT and ERROR on mingw.
Reported by Mike Hommey.
|
| |
|
|
|
|
| |
It was only used by the swap feature, and that is gone.
|
|
|
|
|
| |
In mingw, the test result may contain CRLF while the .exp files don't, or
the other way around.
|
|
|
|
|
|
|
| |
Always initialize tcache data structures if the tcache configuration
option is enabled, regardless of opt_tcache. This fixes
"thread.tcache.enabled" mallctl manipulation in the case when opt_tcache
is false.
|
|
|
|
|
| |
Remove arena_malloc_prechosen(), now that arena_malloc() can be invoked
in a way that is semantically equivalent.
|
| |
|
|
|
|
| |
Reported by Mike Hommey.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
This reverts commit 722b370399fd6734de6781285ce9a0cffd547bdd.
Unfortunately, glibc requires _GNU_SOURCE to be defined before including
string.h, but there is no reliable way to get the prototype within
jemalloc.h unless _GNU_SOURCE was already defined.
|
|
|
|
|
| |
The tls_model attribute isn't supporte by clang (yet?), so add a
configure test that defines JEMALLOC_TLS_MODEL appropriately.
|
|
|
|
|
| |
Add a0malloc(), a0calloc(), and a0free(), which are used by FreeBSD's
libc to allocate/deallocate TLS in static binaries.
|
|
|
|
|
| |
Postpone mutex initialization on FreeBSD until after base allocation is
safe.
|
| |
|
|
|
|
|
|
|
| |
Use $((...)) for math in size_classes.h rather than expr, because it is
much faster. This is not supported syntax in the classic Bourne shell,
but all modern sh implementations support it, including bash, zsh, and
ash.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
s/PAGE_SHIFT/LG_PAGE/g and s/PAGE_SIZE/PAGE/g.
Remove remnants of the dynamic-page-shift code.
Rename the "arenas.pagesize" mallctl to "arenas.page".
Remove the "arenas.chunksize" mallctl, which is redundant with
"opt.lg_chunk".
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 96d4120ac08db3f2d566e8e5c3bc134a24aa0afc.
ivsalloc() depends on chunks_rtree being initialized. This can be
worked around via a NULL pointer check. However,
thread_allocated_tsd_get() also depends on initialization having
occurred, and there is no way to guard its call in free() that is
cheaper than checking whether ptr is NULL.
|
|
|
|
|
|
|
|
|
| |
Generalize isalloc() to handle NULL pointers in such a way that the NULL
checking overhead is only paid when introspecting huge allocations (or
NULL). This allows free() and malloc_usable_size() to no longer check
for NULL.
Submitted by Igor Bukanov and Mike Hommey.
|
| |
|
|
|
|
|
|
| |
Use ffsl() rather than ffs() plus bitshifting in ALLOCM_ALIGN(). The
original rational for using ffs() was portability, but the bitmap code
has since induced a hard dependency on ffsl().
|
|
|
|
|
|
|
|
|
|
| |
Remove code that validates malloc_vsnprintf() and malloc_strtoumax()
against their namesakes. The validation code has adequately served its
usefulness at this point, and it isn't worth dealing with the different
formatting for %p with glibc versus other implementations for NULL
pointers ("(nil)" vs. "0x0").
Reported by Mike Hommey.
|
| |
|
|
|
|
|
|
|
|
|
| |
glibc uses memalign()/free() to allocate/deallocate TLS, which means
that it is unsafe to set TLS variables as a side effect of free() --
they may already be deallocated. Work around this by avoiding
tcache_create() within free().
Reported by Mike Hommey.
|
| |
|
| |
|
|
|
|
|
|
|
| |
sub}_and_fetch() test
With the Android NDK, __sync_{add,sub}_and_fetch() compile fine for uint64_t,
but the corresponding libgcc function aren't there.
|
|
|
|
|
| |
Namely, in the Android NDK headers, SYS_write is not defined; but
__NR_write is.
|
|
|
|
| |
OSX libc calls zone allocators' force_lock/force_unlock already.
|
| |
|
|
|
|
|
|
| |
Force the lazy-lock feature on FreeBSD in order to avoid pthread_self(),
because it causes allocation. (This change was mistakenly omitted from
41b6afb834b1f5250223678c52bd4f013d4234f6.)
|
|
|
|
|
|
| |
Check for NULL ptr in malloc_usable_size(), rather than just asserting
that ptr is non-NULL. This matches behavior of other implementations
(e.g., glibc and tcmalloc).
|