jemalloc/test
Guangli Dai 1dfa6f7aa4 Replace PAI vtable dispatch with direct calls
The pai_t interface implements C-style polymorphism via function pointers
to abstract over PAC and HPA. This abstraction provides no real benefit:
only two implementations exist, the dispatcher already knows which one to
use, and HPA stubs 2 of 5 operations. Remove the runtime dispatch in
favor of direct calls.

This commit:
- Promotes pac_alloc/expand/shrink/dalloc/time_until_deferred_work to
  external linkage and replaces the pai_t *self parameter with pac_t *pac.
- Promotes hpa_alloc/expand/shrink/dalloc/time_until_deferred_work to
  external linkage and replaces pai_t *self with hpa_shard_t *shard.
- Updates hpa_dalloc_batch's signature to take hpa_shard_t * directly
  and removes the hpa_from_pai container-of helper. Updates internal
  callers in hpa_alloc, hpa_dalloc, and hpa_sec_flush_impl.
- Drops the vtable assignments from pac_init() and hpa_shard_init().
- Replaces pai_alloc/dalloc/etc. dispatch in pa.c with direct calls.
  HPA expand and shrink (which are unconditional failure stubs) are
  skipped entirely for HPA-owned extents.
- Removes the pa_get_pai() helper.
- Updates tests in test/unit/hpa.c and test/unit/hpa_sec_integration.c
  to call hpa_alloc/dalloc/etc. directly.

The pai_t struct field stays as dead weight in pac_t and hpa_shard_t;
it is removed in the next commit along with pai.h itself.

No behavioral changes.
2026-05-12 13:43:16 -07:00
..
analyze Revert PR #2608: Manually revert commits 70c94d..f9c0b5 2026-03-10 18:14:33 -07:00
include/test Run single subtest from a test file 2026-03-10 18:14:33 -07:00
integration Reformat the codebase with the clang-format 18. 2026-03-10 18:14:33 -07:00
src Run single subtest from a test file 2026-03-10 18:14:33 -07:00
stress Replace PAI vtable dispatch with direct calls 2026-05-12 13:43:16 -07:00
unit Replace PAI vtable dispatch with direct calls 2026-05-12 13:43:16 -07:00
test.sh.in Renaming limit_usize_gap to disable_large_size_classes 2025-05-06 14:47:35 -07:00