head 1.3; access; symbols pkgsrc-2026Q3:1.2.0.4 pkgsrc-2026Q3-base:1.2 pkgsrc-2026Q2:1.2.0.2 pkgsrc-2026Q2-base:1.2 pkgsrc-2026Q1:1.1.0.56 pkgsrc-2026Q1-base:1.1 pkgsrc-2025Q4:1.1.0.54 pkgsrc-2025Q4-base:1.1 pkgsrc-2025Q3:1.1.0.52 pkgsrc-2025Q3-base:1.1 pkgsrc-2025Q2:1.1.0.50 pkgsrc-2025Q2-base:1.1 pkgsrc-2025Q1:1.1.0.48 pkgsrc-2025Q1-base:1.1 pkgsrc-2024Q4:1.1.0.46 pkgsrc-2024Q4-base:1.1 pkgsrc-2024Q3:1.1.0.44 pkgsrc-2024Q3-base:1.1 pkgsrc-2024Q2:1.1.0.42 pkgsrc-2024Q2-base:1.1 pkgsrc-2024Q1:1.1.0.40 pkgsrc-2024Q1-base:1.1 pkgsrc-2023Q4:1.1.0.38 pkgsrc-2023Q4-base:1.1 pkgsrc-2023Q3:1.1.0.36 pkgsrc-2023Q3-base:1.1 pkgsrc-2023Q2:1.1.0.34 pkgsrc-2023Q2-base:1.1 pkgsrc-2023Q1:1.1.0.32 pkgsrc-2023Q1-base:1.1 pkgsrc-2022Q4:1.1.0.30 pkgsrc-2022Q4-base:1.1 pkgsrc-2022Q3:1.1.0.28 pkgsrc-2022Q3-base:1.1 pkgsrc-2022Q2:1.1.0.26 pkgsrc-2022Q2-base:1.1 pkgsrc-2022Q1:1.1.0.24 pkgsrc-2022Q1-base:1.1 pkgsrc-2021Q4:1.1.0.22 pkgsrc-2021Q4-base:1.1 pkgsrc-2021Q3:1.1.0.20 pkgsrc-2021Q3-base:1.1 pkgsrc-2021Q2:1.1.0.18 pkgsrc-2021Q2-base:1.1 pkgsrc-2021Q1:1.1.0.16 pkgsrc-2021Q1-base:1.1 pkgsrc-2020Q4:1.1.0.14 pkgsrc-2020Q4-base:1.1 pkgsrc-2020Q3:1.1.0.12 pkgsrc-2020Q3-base:1.1 pkgsrc-2020Q2:1.1.0.10 pkgsrc-2020Q2-base:1.1 pkgsrc-2020Q1:1.1.0.6 pkgsrc-2020Q1-base:1.1 pkgsrc-2019Q4:1.1.0.8 pkgsrc-2019Q4-base:1.1 pkgsrc-2019Q3:1.1.0.4 pkgsrc-2019Q3-base:1.1 pkgsrc-2019Q2:1.1.0.2 pkgsrc-2019Q2-base:1.1; locks; strict; comment @ * @; 1.3 date 2026.09.23.13.26.01; author adam; state dead; branches; next 1.2; commitid 1cdf6BDhx6SstKWG; 1.2 date 2026.04.14.12.49.12; author adam; state Exp; branches; next 1.1; commitid 4dcIKm8Go8oMtVBG; 1.1 date 2019.04.24.17.11.00; author adam; state Exp; branches; next ; commitid 4fC9aUNjbhWeNCkB; desc @@ 1.3 log @jemalloc: updated to 5.4.0 5.4.0 (Sep 17, 2026) This release contains over 160 commits, focusing on the technical debts cleaning including refactorings, bug fixes, test coverage improvement, and option cleanups. The release also includes portability improvements per upstream issues report. New features: - Add `EXTENT_ALLOC_FLAG_PINNED` so custom extent-allocation hooks can mark non-reclaimable mappings, such as HugeTLB pages, for preferential reuse outside the decay and purge pipeline. Add the mallctl interfaces `stats.pinned`, `stats.arenas..pinned`, `stats.arenas..extents..npinned`, `stats.arenas..extents..pinned_bytes`, and `stats.arenas..mutexes.extents_pinned.{counter}` to report pinned-memory usage and mutex statistics. (@@binliu19: be2de8cc) - Allow resuming per-CPU arena selection via `thread.arena`. (@@algunenano: 68c35f65) - Better align the contents of human-readable and JSON malloc statistics. (@@spredolac: 68fe1be1, 30b1a410, 04aad97f) - Replace the runtime `experimental_infallible_new` option with the compile-time `--enable-cxx-infallible-new` option, enabling compiler-level optimizations and optimization in move constructors, and fix the `new(std::nothrow)` contract (@@spredolac: 160ab9d7, fe336672) Incompatible changes: - Adapt tcache fill and retention targets per bin to demand observed between GC events, replacing the fixed refill/flush policy. Remove seven legacy non-experimental controls: `lg_tcache_nslots_mul`, `tcache_nslots_small_min`, `tcache_nslots_small_max`, `tcache_nslots_large`, `tcache_gc_delay_bytes`, `lg_tcache_flush_small_div`, and `lg_tcache_flush_large_div`. Corresponding `malloc_conf` settings are silently ignored, matching `opt.*` mallctls return ENOENT, and `tcache_ncached_max` remains supported. (@@spredolac: d13fe91a) Bug fixes: - Preserve `errno` across `free`, `free_sized`, and `free_aligned_sized`, and across `process_madvise`-based page purging. (@@spredolac: 3a779661, 86f05828) - Fix numeric overflow checks in size classes. (@@spredolac: 6b245225) - Accept NULL in `free_sized()` and `free_aligned_sized()` (C23 correctness). (@@bigbruno: 7ce8b916) - Fix TSD lifecycle edge cases by 1) initializing thread-cache bins before marking the cache enabled, preventing reentrant bootstrap allocations from using uninitialized state, and 2) avoiding TSD recreation for late deallocations after thread teardown on generic-TSD platforms. (@@fzakaria: 54f22c83, @@spredolac: fb5499aa) - Use `O_CLOEXEC` when opening the THP sysfs file in `init_thp_state`. (@@ibookstein: d0705543) - Fix duplicate `opt.stats_print` and `opt.stats_print_opts` fields in `malloc_stats_print` output. (@@spredolac: dfe3a2ed) - Fix a potential deadlock during `arena_reset`. (@@guangli-dai: 6957341f) - Fix a prof-sampling / guard-page interaction bug in the SAN. (@@gctony: e36a0fa5) Optimizations and refactors: - Modularize jemalloc's front end by extracting arena management, initialization, fork orchestration, and allocation dispatch from `jemalloc.c`; untangle tcache/arena ownership; and consolidate the internal header graph to eliminate circular dependencies. (@@spredolac: ba1e2fe4, 88745978, 9d757223, de9ad145, ...) - Simplify ctl dispatch by refactoring arena helpers, internalizing an implementation-only control, replacing control-flow macros with typed helpers, and organizing `ctl.c` by subsystem. (@@spredolac: 9e143468, 901365d4, 4e903a0a, 5bc8d6e9) - Cap the base-block growth heuristic to avoid virtual-memory exhaustion under rare racy conditions. (@@guangli-dai: 2f4db8cf) - Move background-thread lifecycle and state operations into the background-thread module, clarifying ownership independently of PAC/HPA callers. (@@guangli-dai: f1f07923) - Simplify the page-allocation boundary by replacing PAI vtable dispatch with direct PAC/HPA calls, removing the obsolete `pai_t`/`pai.h` abstraction, and moving deferred-work and decay orchestration out of the arena. (@@guangli-dai: 1dfa6f7a, 8edd1012, d410f43e) - Refactor statistics collection and rendering into separate gather/emission stages and descriptor-driven tables. (@@spredolac: 184f304d, 80c8fcb4) - Introduce an OS abstraction layer and move platform-dependent file/process I/O, time, synchronization, CPU, virtual-memory, atfork, error-handling, profiling, thread-yield, and configuration-access operations out of allocator core code. (@@guangli-dai: c4158aca, c8e2e013, ...) Portability improvements: - Replace the `std::__throw_bad_alloc` call with standard C++ (@@lexprfuncall: 1a15fe33) - Make `arena_s` use a flexible array member (`bin_t all_bins[]`) for C99 or newer. (@@grueninger: 300b58b4) - Fix rdtscp detection with `--with-lg-vaddr`. (@@xinydev: e8a0d2b4) - Fix `malloc_getcpu` on macOS to read the current CPU number correctly. (@@algunenano: 5aabbc87) - Use `CLOCK_MONOTONIC` for background-thread sleep to prevent clock-rollback stalls, and detect monotonic-condvar support at configure time. (@@antonio2368: ebacec3a, 8361239b) - Fix compilation warnings on macOS. (@@gctony: abb0a8a0) - Fix thread-exit TSD cleanup on MinGW builds. (@@gctony: 1e923170) - Fix GCC 16 build warnings by removing `-Wpedantic` violations in macro and function syntax and explicitly NUL-terminating profiling thread-name copies to resolve `-Wstringop-truncation`. (@@grueninger: 5acdcee6, c22d929a, @@jasonangelov: 6a245e02) - Parse PID-namespace symlinks without glibc-dependent `strtok`/`atol`, and return identifiers as `uint64_t`. (@@guangli-dai: 278d90a5) @ text @$NetBSD: patch-include_jemalloc_internal_quantum.h,v 1.2 2026/04/14 12:49:12 adam Exp $ Add 32-bit SPARC support. --- include/jemalloc/internal/quantum.h.orig 2026-04-14 00:12:37.000000000 +0000 +++ include/jemalloc/internal/quantum.h @@@@ -16,7 +16,7 @@@@ # define LG_QUANTUM 4 # endif # if (defined(__sparc64__) || defined(__sparcv9) \ - || defined(__sparc_v9__)) + || defined(__sparc_v9__) || defined(__sparc__)) # define LG_QUANTUM 4 # endif # if (defined(__amd64__) || defined(__x86_64__) || defined(_M_X64)) @ 1.2 log @jemalloc: updated to 5.3.1 5.3.1 (Apr 13, 2026) This release includes over 390 commits spanning bug fixes, new features, performance optimizations, and portability improvements. Multiple percent of system-level metric improvements were measured in tested production workloads. The release has gone through large-scale production testing at Meta. @ text @d1 1 a1 1 $NetBSD: patch-include_jemalloc_internal_quantum.h,v 1.1 2019/04/24 17:11:00 adam Exp $ @ 1.1 log @jemalloc: updated to 5.2.0 5.2.0: This release includes a few notable improvements, which are summarized below: 1) improved fast-path performance from the optimizations by @@djwatson; 2) reduced virtual memory fragmentation and metadata usage; and 3) bug fixes on setting the number of background threads. In addition, peak / spike memory usage is improved with certain allocation patterns. As usual, the release and prior dev versions have gone through large-scale production testing. New features: Implement oversize_threshold, which uses a dedicated arena for allocations crossing the specified threshold to reduce fragmentation. Add extents usage information to stats. Log time information for sampled allocations. Support 0 size in sdallocx. Output rate for certain counters in malloc_stats. Add configure option --enable-readlinkat, which allows the use of readlinkat over readlink. Add configure options --{enable,disable}-{static,shared} to allow not building unwanted libraries. Add configure option --disable-libdl to enable fully static builds. Add mallctl interfaces: opt.oversize_threshold stats.arenas..extent_avail stats.arenas..extents..n{dirty,muzzy,retained} stats.arenas..extents..{dirty,muzzy,retained}_bytes Portability improvements: Update MSVC builds. Workaround a compiler optimizer bug on s390x. Make use of pthread_set_name_np(3) on FreeBSD. Implement malloc_getcpu() to enable percpu_arena for windows. Link against -pthread instead of -lpthread. Make background_thread not dependent on libdl. Add stringify to fix a linker directive issue on MSVC. Detect and fall back when 8-bit atomics are unavailable. Fall back to the default pthread_create(3) if dlsym(3) fails. Optimizations and refactors: Refactor the TSD module. Avoid taking extents_muzzy mutex when muzzy is disabled. Avoid taking large_mtx for auto arenas on the tcache flush path. Optimize ixalloc by avoiding a size lookup. Implement opt.oversize_threshold which uses a dedicated arena for requests crossing the threshold, also eagerly purges the oversize extents. Default the threshold to 8 MiB. Clean compilation with -Wextra. Refactor the size class module. Refactor the stats emitter. Optimize pow2_ceil. Avoid runtime detection of lazy purging on FreeBSD. Optimize mmap(2) alignment handling on FreeBSD. Improve error handling for THP state initialization. Rework the malloc() fast path. Rework the free() fast path. Refactor and optimize the tcache fill / flush paths. Optimize sync / lwsync on PowerPC. Bypass extent_dalloc() when retain is enabled. Optimize the locking on large deallocation. Reduce the number of pages committed from sanity checking in debug build. Deprecate OSSpinLock. Lower the default number of background threads to 4 (when the feature is enabled). Optimize the trylock spin wait. Use arena index for arena-matching checks. Avoid forced decay on thread termination when using background threads. Disable muzzy decay by default. Only initialize libgcc unwinder when profiling is enabled. Bug fixes (all only relevant to jemalloc 5.x): Fix background thread index issues with max_background_threads. Fix stats output for opt.lg_extent_max_active_fit. Fix opt.prof_prefix initialization. Properly trigger decay on tcache destroy. Fix tcache.flush. Detect whether explicit extent zero out is necessary with huge pages or custom extent hooks, which may change the purge semantics. Fix a side effect caused by extent_max_active_fit combined with decay-based purging, where freed extents can accumulate and not be reused for an extended period of time. Fix a missing unlock on extent register error handling. Testing: Simplify the Travis script output. Update the test scripts for FreeBSD. Add unit tests for the producer-consumer pattern. Add Cirrus-CI config for FreeBSD builds. Add size-matching sanity checks on tcache flush. Incompatible changes: Remove --with-lg-page-sizes. Documentation: Attempt to build docs by default, however skip doc building when xsltproc is missing. @ text @d1 1 a1 1 $NetBSD$ d5 1 a5 1 --- include/jemalloc/internal/quantum.h.orig 2019-04-24 16:37:33.000000000 +0000 d7 9 a15 9 @@@@ -15,7 +15,7 @@@@ # ifdef __alpha__ # define LG_QUANTUM 4 # endif -# if (defined(__sparc64__) || defined(__sparcv9) || defined(__sparc_v9__)) +# if (defined(__sparc64__) || defined(__sparcv9) || defined(__sparc_v9__) || defined(__sparc__)) # define LG_QUANTUM 4 # endif # if (defined(__amd64__) || defined(__x86_64__) || defined(_M_X64)) @