8 ms·
Seems like that would hurt memory locality, with a commensurate increase in cache-misses.
by rocqua 7y ago
Seems like that would hurt memory locality, with a commensurate increase in cache-misses.
- rwmj 7y agoWell Bounds Checking GCC had a huge overhead anyway (making code about 3-5 times slower) so memory locality wasn't our primary concern.
- wahern 7y agoThat's basically how Intel MPX works, https://en.wikipedia.org/wiki/Intel_MPX as well as TinyCC's Bounds Check, https://bellard.org/tcc/tcc-doc.html#Bounds which cites the aforementioned GCC patch. I think AddressSanitizer uses a shadow mapping structure more similar to Valgrind. Although your point about performance still stands. Intel MPX is dead--support removed from GCC, IIRC, because of hints Intel was abandoning it. We'll never know how well it could have been optimized in practice. I think ultimately we simply need proper fat pointers, but those might not become ubiquitous (in the sense of becoming a de facto standard part of shared, C-based platform ABIs) until we see 128-bit native pointers.