jemalloc/test/unit
Tony Printezis f008ce9fe1 Remove hpa_sec_batch_fill_extra and calculate nallocs automatically.
This change includes the following improvements:

- Remove the hpa_sec_batch_fill_extra parameter.
- Refactor the hpa_alloc() code and helper functions to be able to
  allocate more than one extent out of a single pageslab. This way
  we can amortize the per-pageslab costs (active bitmap iteration,
  pageslab metadata updates) across multiple extents.
- Decide on a min and max number of extents that will be allocated
  in hpa_alloc(). The code will try to allocate at least the min
  and allocate up to the max as long as we can allocate additional
  ones from the pageslab we already have, as additional allocations
  are relatively cheap.
- Add extent allocation distribution stats.
- Amend hpa_sec_integration.c unit test.
2026-05-14 11:00:33 -07:00
..
a0.c Improve unit test coverage for jemalloc_init, arenas_management, and jemalloc_fork modules 2026-04-30 15:17:18 -04:00
arena_decay.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
arena_decay.sh Allow opt.tcache_max to accept small size classes. 2020-10-24 20:43:44 -07:00
arena_reset.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
arena_reset_prof.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
arena_reset_prof.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
arenas_management.c Replace arena->tcache_ql with cache_bin_array_descriptor_ql walks 2026-05-13 17:50:41 -04:00
atomic.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
background_thread.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
background_thread_enable.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
background_thread_init.c Fix background thread initialization race 2026-03-10 18:14:33 -07:00
base.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
batch_alloc.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
batch_alloc.sh Add batch allocation API 2020-07-31 09:16:50 -07:00
batch_alloc_prof.c Add batch allocation API 2020-07-31 09:16:50 -07:00
batch_alloc_prof.sh Add batch allocation API 2020-07-31 09:16:50 -07:00
bin.c Hide bin slab-locality query behind arena_locality_hint 2026-05-13 17:50:41 -04:00
binshard.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
binshard.sh Fix binshard.sh by specifying bin_shards for all sizes. 2025-05-28 19:21:49 -07:00
bit_util.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
bitmap.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
buf_writer.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
cache_bin.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
ckh.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
conf.c Add unit tests for conf parsing and its helpers 2026-03-10 18:14:33 -07:00
conf_init_0.c Add unit tests for conf parsing and its helpers 2026-03-10 18:14:33 -07:00
conf_init_1.c Add unit tests for conf parsing and its helpers 2026-03-10 18:14:33 -07:00
conf_init_confirm.c Add unit tests for conf parsing and its helpers 2026-03-10 18:14:33 -07:00
conf_parse.c Fix conf_handle_char_p zero-sized dest and remove unused conf_handle_unsigned 2026-04-01 23:15:19 -04:00
counter.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
decay.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
div.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
double_free.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
double_free.h Eagerly detect double free and sized dealloc bugs for large sizes. 2020-10-15 10:03:16 -07:00
edata_cache.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
emitter.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
extent_alloc_flags.c Introduce pinned extents to contain unpurgeable pages 2026-05-05 10:44:28 -07:00
extent_dss.c Add DSS allocation path unit tests 2026-05-12 13:14:39 -04:00
extent_quantize.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
fb.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
fork.c Add postfork descriptor relink test to unit/fork 2026-05-13 17:50:41 -04:00
fxp.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
hash.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
hpa.c Replace PAI vtable dispatch with direct calls 2026-05-12 13:43:16 -07:00
hpa.sh When extracting from central, hugify_eager is different than start_as_huge 2026-03-10 18:14:33 -07:00
hpa_background_thread.c Replace PAI vtable dispatch with direct calls 2026-05-12 13:43:16 -07:00
hpa_background_thread.sh When extracting from central, hugify_eager is different than start_as_huge 2026-03-10 18:14:33 -07:00
hpa_sec_integration.c Remove hpa_sec_batch_fill_extra and calculate nallocs automatically. 2026-05-14 11:00:33 -07:00
hpa_sec_integration.sh [SEC] Make SEC owned by hpa_shard, simplify the code, add stats, lock per bin 2026-03-10 18:14:33 -07:00
hpa_thp_always.c Replace PAI vtable dispatch with direct calls 2026-05-12 13:43:16 -07:00
hpa_thp_always.sh When extracting from central, hugify_eager is different than start_as_huge 2026-03-10 18:14:33 -07:00
hpa_vectorized_madvise.c Replace PAI vtable dispatch with direct calls 2026-05-12 13:43:16 -07:00
hpa_vectorized_madvise.sh When extracting from central, hugify_eager is different than start_as_huge 2026-03-10 18:14:33 -07:00
hpa_vectorized_madvise_large_batch.c Remove dead pai_t field and delete pai.h 2026-05-12 13:43:16 -07:00
hpa_vectorized_madvise_large_batch.sh [process_madvise] Use process_madvise across multiple huge_pages 2025-04-25 19:19:03 -07:00
hpdata.c [HPA] Add ability to start page as huge and more flexibility for purging 2026-03-10 18:14:33 -07:00
huge.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
inspect.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
inspect.sh Add the profiling settings for tests explicit. 2021-12-22 20:10:28 -08:00
jemalloc_init.c Hide methods from jemalloc_init.h that are not used in other units 2026-05-11 16:23:09 -07:00
json_stats.c Emit retained HPA slab stats in JSON 2026-04-01 23:15:19 -04:00
junk.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
junk.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
junk_alloc.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
junk_alloc.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
junk_free.c Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
junk_free.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
large_ralloc.c Fix missing negation in large_ralloc_no_move usize_min fallback 2026-04-01 23:15:19 -04:00
log.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
mallctl.c Remove hpa_sec_batch_fill_extra and calculate nallocs automatically. 2026-05-14 11:00:33 -07:00
malloc_conf_2.c Add unit tests for conf parsing and its helpers 2026-03-10 18:14:33 -07:00
malloc_conf_2.sh Add malloc_conf_2_conf_harder 2020-03-31 06:25:08 -07:00
malloc_io.c Fix out-of-bounds write in malloc_vsnprintf when size is 0 2026-04-01 23:15:19 -04:00
math.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
mpsc_queue.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
mq.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
mtx.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
ncached_max.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
nstime.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
oversize_threshold.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
pa.c Fix missing release of acquired neighbor edata in extent_try_coalesce_impl 2026-04-01 23:15:19 -04:00
pack.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
pack.sh Refactor *decay_time into *decay_ms. 2017-05-18 11:33:45 -07:00
pages.c Refactor init_system_thp_mode and print it in malloc stats. 2026-03-10 18:14:33 -07:00
peak.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
ph.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prng.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_accum.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_accum.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
prof_active.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_active.sh Add the profiling settings for tests explicit. 2021-12-22 20:10:28 -08:00
prof_gdump.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_gdump.sh Enable heap profiling on MacOS 2024-04-09 12:57:01 -07:00
prof_hook.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_hook.sh Making jemalloc max stack depth a runtime option 2022-09-12 13:56:22 -07:00
prof_idump.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_idump.sh Remove --disable-tcache. 2017-04-21 10:06:12 -07:00
prof_log.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_log.sh Add the profiling settings for tests explicit. 2021-12-22 20:10:28 -08:00
prof_mdump.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_mdump.sh Push error handling logic out of core dumping logic 2020-06-29 14:27:50 -07:00
prof_recent.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_recent.sh Add the prof_sys_thread_name feature in the prof_recent unit test. 2023-05-11 09:10:57 -07:00
prof_reset.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_reset.sh Last-N profiling mode 2019-12-30 15:58:57 -08:00
prof_small.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_small.sh Add a test-case for small profiled allocations 2023-07-03 16:19:06 -07:00
prof_stats.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_stats.sh Add the profiling settings for tests explicit. 2021-12-22 20:10:28 -08:00
prof_sys_thread_name.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_sys_thread_name.sh Add the profiling settings for tests explicit. 2021-12-22 20:10:28 -08:00
prof_tctx.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_tctx.sh Add the profiling settings for tests explicit. 2021-12-22 20:10:28 -08:00
prof_thread_name.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
prof_thread_name.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
psset.c Fix psset_pick_purge when last candidate with index 0 dirtiness is ineligible 2026-03-26 10:39:37 -07:00
ql.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
qr.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
rb.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
retained.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
rtree.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
safety_check.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
safety_check.sh Add the profiling settings for tests explicit. 2021-12-22 20:10:28 -08:00
san.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
san.sh San: Rename 'guard' to 'san' 2021-12-15 10:39:17 -08:00
san_bump.c Fix memory leak of old curr_reg on san_bump_grow_locked failure 2026-04-01 23:15:19 -04:00
sc.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
sec.c Remove hpa_sec_batch_fill_extra and calculate nallocs automatically. 2026-05-14 11:00:33 -07:00
SFMT.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
size_check.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
size_check.sh Add the profiling settings for tests explicit. 2021-12-22 20:10:28 -08:00
size_classes.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
size_classes.sh Renaming limit_usize_gap to disable_large_size_classes 2025-05-06 14:47:35 -07:00
slab.c Move bin inline functions from arena_inlines_b.h to bin_inlines.h 2026-03-10 18:14:33 -07:00
smoothstep.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
spin.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
stats.c Add a mallctl for users to get an approximate of active bytes. 2026-03-10 18:14:33 -07:00
stats_print.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
sz.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
tcache_init.c Handle tcache init failures gracefully 2026-03-10 18:14:33 -07:00
tcache_max.c Fix large alloc nrequests under-counting on cache misses 2026-04-01 23:15:19 -04:00
tcache_max.sh skip tcache GC for tcache_max unit test 2024-06-25 12:59:45 -07:00
test_hooks.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
thread_event.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
thread_event.sh Build a general purpose thread event handler 2019-11-04 11:15:50 -08:00
ticker.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
tsd.c Remove generic experimental hooks 2026-05-13 18:27:43 -04:00
uaf.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
witness.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
zero.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
zero.sh Use MALLOC_CONF rather than malloc_conf for tests. 2017-02-23 08:57:02 -08:00
zero_realloc_abort.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
zero_realloc_abort.sh Realloc: Make behavior of realloc(ptr, 0) configurable. 2019-10-29 17:48:44 -07:00
zero_realloc_alloc.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
zero_realloc_alloc.sh Rename zero_realloc option "strict" to "alloc". 2022-04-20 10:27:25 -07:00
zero_realloc_free.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
zero_realloc_free.sh Realloc: Make behavior of realloc(ptr, 0) configurable. 2019-10-29 17:48:44 -07:00
zero_reallocs.c Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
zero_reallocs.sh Add stats counters for number of zero reallocs 2019-10-29 17:48:44 -07:00