4 ms·
I'm pretty sure some cpp vector implementations use three pointers instead of length and capacity.
by blt 9y ago
I'm pretty sure some cpp vector implementations use three pointers instead of length and capacity.
- saagarjha 9y agoIn the end, it's the same thing, isn't it? The amount of overhead is the same.
- blt 9y agoIn the article, it sounded like there is actually a guarantee that the (pointer, integer, integer) representation is used in rust. They are close to being equivalent, but maybe with weird-sized objects, the (pointer, pointer, pointer) version requires some divisions, and the other one only requires multiplications?