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.
- Host: GitHub
- URL: https://github.com/demindiro/temp-alloc
- Owner: Demindiro
- Created: 2018-12-19T10:05:31.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-12-19T10:05:54.000Z (over 7 years ago)
- Last Synced: 2025-02-07T06:26:35.127Z (over 1 year ago)
- Language: C
- Size: 1000 Bytes
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.