3 ms·
On one hand, really nice to see the whole thing in 1000 lines of C code. On the other hand, that malloc function low key terrifies me. :)
by davedx 3y ago
On one hand, really nice to see the whole thing in 1000 lines of C code.
On the other hand, that malloc function low key terrifies me. :)
- flohofwoe 3y agoBetter to be explicit than hiding unsafe memory accesses under C++ stdlib classes like std::vector which don't do range checking either in operator[]. And in this sort of code, automatically injected runtime range checks would most likely hurt performance enough to matter. I would still run the code through the Clang static analyzer and a couple of test runs in ASAN and UBSAN to be sure that nothing slipped through.