Re: Whats going onto the stack here?

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi Igor,

Thanks for the quick response.

So don't delete them recursively, delete them iteratively.

D'Oh!, I have now changed to iterative deletion of the linked list. No more
stack overflows, Thanks.

Every function call needs some stack space for return address, saving
registers, and local variables

I see, so as its recursively deleting its storing the return address plus
other various data for each object on the stack meaning it runs out of room
before it manages to delete the whole list, and unwind itself.
Makes sense.

Having said all this, why are you writing your own linked list class in
this day and age? Why not use stl::list ?


It only takes 5 minutes to throw together a linked list, hardly re-inventing
the wheel. I never learnt stl; plus it looks a mess. Im sure people will say
its not hard, but i find it easier writing my own code for small things like
this.

Thanks for your help, its much appreciated.


.