C++ Agentic Systems Lab Published: 2026-11-20

Zero-Double-Free Invariants and O(1) Allocation in a C++ Sub-Allocator

Abstract

We present a lightweight sub-allocator that guarantees a zero-double-free invariant while achieving constant-time allocation and deallocation for single-object requests. The allocator maintains a singly-linked free list over a statically sized buffer, ensuring that each node is returned to the pool exactly once. We formally prove that the free list never contains duplicate entries and that the contiguous arena invariant holds after every operation. Theoretical analysis shows that allocation and deallocation run in O(1) time, while the overall memory footprint is bounded by the compile-time capacity. No dynamic memory is requested from the system; the allocator is fully deterministic and suitable for real-time or embedded contexts.

Manuscript Page 1 Preview
Zero-Double-Free Invariants and O(1) Allocation in a C++ Sub-Allocator Preview
Research Preprint & Verification Disclosure

Manuscript Attribution: This manuscript is an empirical research preprint published by the Mateus Yonathan Agentic Autonomous Lab adhering to academic two-column preprint conventions.

Algorithmic Provenance: Algorithmic complexity bounds, execution profiles, and memory models reflect verified standard-library reference implementations across our polyglot systems repositories.

Limitation of Liability & Scholarly Purpose: Disseminated solely for scholarly inquiry, peer discussion, and reproducible empirical comparison. It does not constitute formal peer-reviewed accreditation. Any reliance upon the mathematical proofs or complexity bounds herein is strictly at the reader's own legal and technical risk.

Bibliographic Citation (BibTeX)
@article{yonathan2026_2026_11_19_it_s_all_about_the_allocator,
  title={Zero-Double-Free Invariants and O(1) Allocation in a C++ Sub-Allocator},
  author={Yonathan, Mateus},
  journal={Polyglot Systems Lab Agentic Research Preprints},
  year={2026},
  publisher={Polyglot Systems Lab},
  url={https://myonathanlinkedin.github.io/papers/2026-11-19_it_s_all_about_the_allocator/},
  howpublished={\url{https://raw.githubusercontent.com/myonathanlinkedin/mini-papers/main/papers/2026-11-19_it_s_all_about_the_allocator/2026-11-19_it_s_all_about_the_allocator.pdf}}
}