Release v1.0.0: Standalone EStack Allocator and Dedicated Infrastructure
This stable release introduces easy_stack (EStack) as a fully independent, standalone header-only C library. Derived from the easy_memory ecosystem, this allocator is designed for fast, zero-dependency LIFO memory management.
Standalone LIFO Stack Allocator
- Inverted Bi-Directional Layout: Eliminates standard inline metadata overhead by growing metadata (offsets array) forward from the start of the buffer and aligned payloads backward from the end. This isolates control paths and removes intermediate padding gaps.
- Dynamic Metadata Scaling: Automatically adapts offset array cell sizes (1, 2, 4, or 8 bytes) based on the stack's overall capacity. For standard frame workloads (< 64 KB), each offset requires only 2 bytes (
uint16_t), reducing metadata overhead compared to traditional inline headers. - Zero-Multiplication Boundary Checks: Replaces expensive CPU multiplication instructions with fast bitwise shifts (
<< meta_type) on the hot allocation path, reducing boundary checks to a minimum of CPU cycles. - Clean Standalone API: Completely removed parent arena dependencies (
EMandBlocklinkages). Provides native dynamic (estack_create) and static (estack_create_static) construction paths out of the box.
Performance & Hot Path Optimizations
- Hot Path Branch Prediction: Optimized metadata read/write operations using compiler branch prediction hints. This restructured instruction pipelines to prioritize highly expected 16-bit and 32-bit metadata paths.
- Hardware-Limit Throughput: Reached up to 939 Million ops/sec (~1.06 ns per cycle) in trusted
CONTRACTmode, and up to 615 Million ops/sec (a +33% performance boost) inDEFENSIVEsafety mode on x86_64. - Instruction Latency Hiding: In
DEFENSIVEmode, CPU-bound execution masks memory prefetching latency, maintaining flat, stable, and highly predictable performance across all stack allocation depths.
Cryptographically Hardened Markers
- XOR-Hardening: Implements secure rollback state tokens (
EStackMarker). Both the index and validation signature are XOR-encrypted using the stack's base address andESTACK_MAGIC, protecting against cross-allocator marker pollution and forged rollbacks.
Diagnostic Visualization
- Non-Allocating Diagnostics (
estack_print): Integrated a zero-allocation debugging API to print detailed stack metrics (min/max/average object sizes and total buffer utilization) on-the-fly.
Portability & Bare-Metal Compliance
- Bare-Metal AVR Hardening: Resolved compiler-warning constraints on 8/16-bit bare-metal platforms when custom alignment options (
ESTACK_NO_AUTO_ALIGN) are active, ensuring clean compilation ofestack_alloc_alignedacross all optimization matrices.
Complex inside. Simple outside.