2 ms·
To be clear, there is no tradeoff in the number of operations. You are doing the exact same number on average (or total or amortized), while improving the worst
by remram 5y ago
To be clear, there is no tradeoff in the number of operations. You are doing the exact same number on average (or total or amortized), while improving the worst-case.
You do lose the ability to do a no-copy realloc() though, and increase the average memory use (not peak).