20f1fc95ad
Add a library constructor for jemalloc that initializes the allocator. This fixes a race that could occur if threads were created by the main thread prior to any memory allocation, followed by fork(2), and then memory allocation in the child process. Fix the prefork/postfork functions to acquire/release the ctl, prof, and rtree mutexes. This fixes various fork() child process deadlocks, but one possible deadlock remains (intentionally) unaddressed: prof backtracing can acquire runtime library mutexes, so deadlock is still possible if heap profiling is enabled during fork(). This deadlock is known to be a real issue in at least the case of libgcc-based backtracing. Reported by tfengjun. |
||
---|---|---|
.. | ||
arena.h | ||
atomic.h | ||
base.h | ||
bitmap.h | ||
chunk_dss.h | ||
chunk_mmap.h | ||
chunk.h | ||
ckh.h | ||
ctl.h | ||
extent.h | ||
hash.h | ||
huge.h | ||
jemalloc_internal.h.in | ||
mb.h | ||
mutex.h | ||
private_namespace.h | ||
prng.h | ||
prof.h | ||
ql.h | ||
qr.h | ||
quarantine.h | ||
rb.h | ||
rtree.h | ||
size_classes.sh | ||
stats.h | ||
tcache.h | ||
tsd.h | ||
util.h |