Skip to content

v1.2.0

Latest

Choose a tag to compare

@github-actions github-actions released this 09 Jul 20:50
d277258

pbr-cpp-memory-pool v1.2.0 — Milestone 9 (Ergonomics, Hardening & Tooling)

The first post-v1.0.0 MINOR. v1.2.0 closes Milestone 9 — a coherent wave of additive, ABI-compatible capabilities on top of the frozen public surface. The v1.0.0 C ABI and C++ types are unchanged: a default build is byte-for-byte and cycle-for-cycle what v1.1.x shipped. Every new capability is header-only, behind an opt-in compile-time knob, or test/bench-only — so nothing here can perturb an existing consumer that does not ask for it.

Added

  • [#107] std::pmr::memory_resource adapter — PoolMemoryResource (ADR-0042). A header-only Adapter that binds one Pool behind the runtime std::pmr::memory_resource interface, so any std::pmr container can draw from it through std::pmr::polymorphic_allocator without the per-type PoolAllocator<T> rebind — the "door left open" in ADR-0018. Deterministic (bytes, alignment) routing; over-sized / over-aligned requests fall back to a configurable upstream resource; exhaustion throws std::bad_alloc; is_equal by (pool, upstream) identity. Gated behind PBR_MEMORY_POOL_HAS_PMR where <memory_resource> exists.
  • [#109] Opt-in debug hardening (ADR-0043). A compile-time knob PBR_MEMORY_POOL_HARDENING (OFF by default; a harden preset turns it on) hardens the intrusive free list: freed-block poisoning (0xDE) catches use-after-free on the next allocation; a per-slot trailing guard word catches a write past block_size (buffer overflow) and a repeated free (double-free — the ADR-0012 gap); and glibc-style safe-linking (ptr XOR (slot_addr >> 12)) protects the in-band next-link. A swappable HardeningViolationHandler reports violations (the default aborts). The guard lives in added slot stride, so block_size and the ADR-0009 alignment guarantee are unchanged and the default build is fully compiled out. A harden CI cell builds and tests it on each Tier-1 platform (including MSVC, where ASan is unavailable).
  • [#108] Coverage-guided fuzzing harness (ADR-0044). pool_fuzz.cpp drives randomized alloc/free sequences through a stateful opcode interpreter, asserting no-alias, per-block-canary, foreign/NULL-no-op, and InstrumentedPool accounting invariants against a shadow oracle. One engine-agnostic source yields the Clang-only libFuzzer target pool_fuzz (opt-in, run bounded on every PR by a dedicated fuzz CI job) and an always-built standalone pool_fuzz_replay that gates the seed corpus everywhere — including MSVC, where libFuzzer is unavailable.
  • [#111] Benchmark extension — tail-latency percentiles + external baselines (ADR-0045, extends ADR-0014). An opt-in --percentiles mode emits a per-operation p50/p90/p99/p999 table; the dynamic-pool growth row surfaces the microsecond-scale growth spike the aggregate median hides. jemalloc / tcmalloc are measured by re-running the bench under LD_PRELOAD (they take over global malloc on load, so they cannot be linked or dlopen'd beside the system allocator — an in-process attempt was tried and rejected); a # allocator: header discloses which allocator each run measured. The bench carries no allocator-specific code, so the aggregate ns/op table and its committed numbers are unchanged.
  • [#105] C4 component diagram of the pool internals in the specification (§4.2), authored in Mermaid (ADR-0041) — closing the last open item of the specification review.

Changed

  • The specification was reconciled with the as-built system (cross-linked realizing ADRs, formalized subsection anchors, a §7 spec→ADR map), and the Milestone 9 features were folded into it as they shipped. The zh-Hans / ja README translations were re-synced to the v1.1.2 status. Documentation-only; no API change.

Architecture Decision Records

Five new ADRs — 0041 (Mermaid diagram tooling), 0042 (pmr adapter), 0043 (debug hardening), 0044 (fuzzing harness), and 0045 (benchmark percentiles + baselines) — bring the running total to 45.

Spec Coverage Map

No regression — all rows remain ✅ (ADR-0029). The new features realize previously-deferred §4.1/§5.3 (hardening), §6.3 (percentiles + baselines), and §6.4 (fuzzing) items, now mapped in the spec's §7.

What this release does not contain

  • No public-API/ABI change. Pool, TypedPool, PoolAllocator, InstrumentedPool, the C ABI, and the existing compile-time knobs are unchanged. PoolMemoryResource is a new additive type; PBR_MEMORY_POOL_HARDENING / PBR_MEMORY_POOL_BUILD_FUZZERS are new opt-in build knobs, OFF by default.
  • No behaviour change in a default build. Hardening, the fuzzer, and the benchmark additions are all opt-in or test/bench-only.

Verifying the release

Each platform tarball is the same complete cmake --install tree as v1.1.x (full headers + static archive + CMake package config + pkg-config .pc). SHA-256 checksums are in SHA256SUMS:

sha256sum --check SHA256SUMS

Links