C++ replacement for C99 VLAs (goal: preserve performance)
Create a large buffer (MB+) in thread-local storage. (Actual memory on heap, management in TLS). Allow clients to request memory from it in FILO manner (stack-like). (this mimics how it works in C VLAs; and it is efficient, as each request/return is just an integer addition/subtraction). Get your VLA storage from it. Wrap it pretty, … Read more