Skip to content

Out-of-memory error handling

Pre-release
Pre-release
Compare
Choose a tag to compare
@mittinatten mittinatten released this 18 Sep 16:29
· 789 commits to master since this release

Instead of checking failed malloc/realloc by asserts it is now done by returning error codes and printing error messages. Tested by compiling with broken malloc/realloc (see tests/broken-malloc.c). These errors are very unlikely to occur in a library of this type (relatively small memory footprint), but now the library can be integrated into other programs with a smaller risk of it causing a crash due to system problems.

Tweaking of S&R gave 5-10 % speed increase.

Added unit tests of some static functions in tests/test_static.c. More tests can/should be added eventually.