Hacker News new | ask | show | jobs
by rapidlua 1347 days ago
As of today, vector’s iterator is just a pointer. You need more than just a pointer to detect out of bounds accesses. It makes old binaries incompatible with new binaries. It also means that you can’t mix and match, it must be either a or b.

Hence you can’t make the change incrementally, which is a big risk.

Concerning Linux distributions, I seriously doubt if they have resources to assess the performance impact across the wide range of software.

Concerning performance impact, we end up with more instructions and more memory accesses and increased register pressure. This has a chance to make things slower.

2 comments

Perhaps you could keep ABI compatible using with versioned symbols?
If the functions are separate overloads there is no need of versioning in the first place.

On the other hand if you change the layout of structures (like it would be the case for bound checked pointers), it is much much harder. GCC has ABI tags, but they only help a bit.

In any case nobody is going to bound check iterators by default, these already exists when using whatever debug standard library your compiler provides and they are orders of magnitude slower than unchecked iterators.

Can it not work on individual software programs though? And use a shim to access non-safe buffers?