This release contains over 160 commits, focusing on the technical debts
New features:
- Add
EXTENT_ALLOC_FLAG_PINNED so custom extent-allocation hooks can
- Allow resuming per-CPU arena selection via
thread.arena.
- Better align the contents of human-readable and JSON malloc statistics.
- Replace the runtime
experimental_infallible_new option with the
Incompatible changes:
- Adapt tcache fill and retention targets per bin to demand observed
Bug fixes:
- Preserve
errno across free, free_sized, and free_aligned_sized,
- Fix numeric overflow checks in size classes. (@spredolac: 6b24522)
- Accept NULL in
free_sized() and free_aligned_sized() (C23
- Fix TSD lifecycle edge cases by 1) initializing thread-cache bins before
- Use
O_CLOEXEC when opening the THP sysfs file in init_thp_state.
- Fix duplicate
opt.stats_print and opt.stats_print_opts fields in
- Fix a potential deadlock during
arena_reset. (@guangli-dai: 6957341)
- Fix a prof-sampling / guard-page interaction bug in the SAN. (@gctony:
Optimizations and refactors:
- Modularize jemalloc's front end by extracting arena management,
- Simplify ctl dispatch by refactoring arena helpers, internalizing an
- Cap the base-block growth heuristic to avoid virtual-memory exhaustion
- Move background-thread lifecycle and state operations into the
- Simplify the page-allocation boundary by replacing PAI vtable dispatch
- Refactor statistics collection and rendering into separate
- Introduce an OS abstraction layer and move platform-dependent
Portability improvements:
- Replace the
std::__throw_bad_alloc call with standard C++ (#2900).
- Make
arena_s use a flexible array member (bin_t all_bins[]) for C99
- Fix rdtscp detection with
--with-lg-vaddr. (@xinydev: e8a0d2b)
- Fix
malloc_getcpu on macOS to read the current CPU number correctly.
- Use
CLOCK_MONOTONIC for background-thread sleep to prevent
- Fix compilation warnings on macOS. (@gctony: abb0a8a)
- Fix thread-exit TSD cleanup on MinGW builds. (@gctony: 1e92317)
- Fix GCC 16 build warnings by removing
-Wpedantic violations in macro
- Parse PID-namespace symlinks without glibc-dependent
strtok/atol,