Re:The lost malloc()
by fasterik on Wednesday November 04, 2026 @09:51AM
(#50366319)
That's why I put the word "potential" in there. Every allocation potentially needs to go to the OS for more pages.
[ Parent
| on HN ]
And every memory access potentially enters the kernel via a page fault.
Any given CPU instruction potentially isn't in cache.
And yet, they can't all not be in cache. As soon as the cache is accessed for one instruction, a bunch more are pulled in too.
Any given vector.push call could reallocate the vector, but it's amortized O(1).