3 ms·
Pretty good work so far. Some nitpicks… The library uses malloc rather liberally, but rarely (if, ever) checks the result. Allocation functions failing to allo
by acuozzo 3y ago
Pretty good work so far. Some nitpicks…
The library uses malloc rather liberally, but rarely (if, ever) checks the result. Allocation functions failing to allocate is a recoverable state¹.
In addition to this, the library does not provide a builtin mechanism to override malloc from the stdlib. Freestanding targets exist! Also, on hosted targets, who isn't using aligned_alloc in at least some places nowadays?
Having to do the following song & dance sucks.
#define malloc xmalloc
#include <yourthing.h>
#undef malloc
[1] I'd wager most C programmers today write programs in C to exercise as much control (maximal determinism?) as possible without having to write in *-Assembly. Yes, I'm aware that its abstract model of computation and semantic complexity make it anything but "low-level", but C can get rather close on some architectures with some compilers.