4 ms·
> C does not have RAII-like memory management in any way. C does not have memory management in any way period. The C standard library does. How you get to some
by sedachv 9y ago
> C does not have RAII-like memory management in any way.
C does not have memory management in any way period. The C standard library does. How you get to something with dynamic scoping like RAII in C is to use a different library for managing memory. For example Thinlisp[1] and Ravenbrook's Memory Pool System[2] both provide dynamically-scoped region/pool allocation schemes.
[1] https://github.com/vsedach/Thinlisp-1.1 https://github.com/vsedach/Thinlisp-1.1
[2] https://www.ravenbrook.com/project/mps/ https://www.ravenbrook.com/project/mps/