4 ms·
The tools for rooting out these problems have gotten a lot better, thankfully. I'm very fond of the address sanitizer. Using calloc() everywhere can prevent t
by dietrichepp 11y ago
The tools for rooting out these problems have gotten a lot better, thankfully. I'm very fond of the address sanitizer. Using calloc() everywhere can prevent the address sanitizer from finding problems.
- neopallium 11y agoGCC (>=4.8) & Clang now have Address Sanitizer support for fast memory error detection. About a 2x slowdown [1]. 0. https://github.com/google/sanitizers/wiki/AddressSanitizer https://github.com/google/sanitizers/wiki/AddressSanitizer 1. https://github.com/google/sanitizers/wiki/AddressSanitizerPerformanceNumbers https://github.com/google/sanitizers/wiki/AddressSanitizerPe...
- gsg 11y agoYou could try to split the difference by using a wrapper around malloc that zeroes in production and doesn't under testing. Of course, running significantly different code in production and test has its own issues.