mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-10-28 08:46:36 +08:00
3d07f2b597cab708f7c5e0122f8e16b8a4915dba
je_dallocx() kept the flags != 0 path inline, so the whole function got one stack frame and register assignment sized for the slow path, and the flags == 0 fast path paid for it: callee-saved register spills, and with clang after the emap_alloc_ctx_lookup() L1 inlining, an extra register move. Move the flags != 0 body into a noinline dallocx_default(), matching free_default(), sdallocx_default() and mallocx_default(). dallocx(ptr, 0) now has the same fast path as free(): no frame setup and no spills. flags != 0 callers pay one extra call. Instructions retired per mallocx() + dallocx(ptr, 0) pair on aarch64: gcc -O3, libjemalloc.so: 103.6 -> 98.6 clang ThinLTO, libjemalloc.so: 117.5 -> 105.5 clang ThinLTO, statically linked: 106.5 -> 82.5 On x86-64 with clang ThinLTO, the dallocx(ptr, 0) path goes from 57 to 37 instructions.
jemalloc is a general purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support. jemalloc first came into use as the FreeBSD libc allocator in 2005, and since then it has found its way into numerous applications that rely on its predictable behavior. In 2010 jemalloc development efforts broadened to include developer support features such as heap profiling and extensive monitoring/tuning hooks. Modern jemalloc releases continue to be integrated back into FreeBSD, and therefore versatility remains critical. Ongoing development efforts trend toward making jemalloc among the best allocators for a broad range of demanding applications, and eliminating/mitigating weaknesses that have practical repercussions for real world applications. The COPYING file contains copyright and licensing information. The INSTALL file contains information on how to configure, build, and install jemalloc. The ChangeLog file contains a brief summary of changes for each release. URL: https://jemalloc.net/
Languages
C
88.4%
Perl
4.7%
M4
3.1%
Python
1.2%
Shell
1%
Other
1.6%