Oh, you meant clear()... No, I didn't miss it. The vector goes out of scope and so it gets cleared anyway. But even if I did miss clear, it would only make my app hold an additional of 45000*sizeof(int*) = ~180kB of memory.
Oh, you meant clear()... No, I didn't miss it. The vector goes out of scope and so it gets cleared anyway. But even if I did miss clear, it would only make my app hold an additional of 45000*sizeof(int*) = ~180kB of memory.
The biggest difference between time and space is that you can't reuse time.
-- Merrick Furst
Yes, I understand your point. But note that I wrote this wasn't the actual code. In the real app I was probably using the index operator to fill the vector, otherwise delete vecs[i] would have crashed the application during the second iteration of the loop (because of trying to delete an unallocated block of memory). And if you read my original post again, you'll see this line:
Originally Posted by wysota
The biggest difference between time and space is that you can't reuse time.
-- Merrick Furst
There was no cut&paste. I had the program written in /tmp which is a ramdisk. And I had to reboot my computer after running the application. Guess the rest![]()
Bookmarks