An open API service indexing awesome lists of open source software.

https://github.com/demindiro/temp-alloc

A C library to make temporary memory allocations without worrying about free.
https://github.com/demindiro/temp-alloc

Last synced: over 1 year ago
JSON representation

A C library to make temporary memory allocations without worrying about free.

Awesome Lists containing this project

README

          

Temporary alloc
===============

This library is useful if you need to create a lot of temporary object that
cannot be allocated on the stack.

To allocate a frame, use `temp_alloc_push(size_t)`. You can then allocate memory
with `temp_alloc(size_t)`. If you need to free the memory again, you can use
`temp_alloc_pop(void)` to free all allocated memory.

You can push multiple frames at once. Doing so will preserve any allocations made
before the second push when calling pop.