C3's Temp Allocator: Automatic Memory Management Without the Overhead
C3 introduces a novel memory management solution called the Temp allocator, combining the ease of garbage collection with the performance of manual memory management. Leveraging memory regions (arenas), the Temp allocator automatically frees memory when a function's scope ends, preventing memory leaks without the complexity of RAII, reference counting, or garbage collection. Using the `@pool()` macro defines memory regions, allowing developers to easily manage temporary variable lifecycles, with Valgrind tests demonstrating its effectiveness. C3 even automatically adds a `@pool()` scope to the `main()` function if no explicit one is provided, further simplifying the development process. The Temp allocator lets C3 developers enjoy the performance of manual memory management without the risk of memory leaks.