This patch release introduces critical memory safety hardening, robust compile-time validation, and API refinements.
Safety & Hardening
- Defensive Rollback Guard: Added an unconditional check in
estack_free_to_markerto prevent out-of-bounds reads and memory corruption when using corrupted markers underCONTRACTrelease builds. - Truncation Protection: Added a static assertion to prevent silent truncation of
ESTACK_MAGICon 32-bit platforms.
Static Validation & Configuration
- Power-of-Two Enforcement: Added static assertions ensuring
ESTACK_MIN_ALIGNMENTandESTACK_DEFAULT_HEADER_ALIGNMENTare valid powers of two. - Alignment Logic Fixes: Enforced a minimum header alignment limit and corrected configuration overrides to prevent breaking
ESTACK_NO_AUTO_ALIGNmode.
API & Documentation
- Refined Diagnostics: Removed
constfromestack_printto correctly match its internal stack-allocation diagnostics. - Strict Alignment Warnings: Documented hardware fault risks on strict-alignment platforms when disabling payload or header alignment.
Complex inside. Simple outside.