forked from thi-ng/tinyalloc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctness fixes and (optional) better C stdlib integration
- Add early NULL check to ta_free() - Add overflow checks in alloc_block() and ta_calloc() - Clear full block size to 0's in ta_calloc() - Optionally set errno to ENOMEM when out of memory - Optionally use memset() to implement memclear() - Add ta_getsize() to return allocated block size - Add ta_realloc() (optional, requires memcpy()) ta_getsize() and ta_realloc() are based on ideas from thi-ng#11, but rewritten to fix various issues in that PR.
- Loading branch information
1 parent
b60fcd7
commit ccdaa00
Showing
2 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters