possibly ignorant question about the stack

Reply

Join Date: Sep 2004
Posts: 4
Reputation: elspork is an unknown quantity at this point 
Solved Threads: 0
elspork elspork is offline Offline
Newbie Poster

possibly ignorant question about the stack

 
0
  #1
Sep 23rd, 2004
What I'd like to know is if there is a way to tell how much space I have available in the stack and put that size into a variable.
ie long x = [stacksize]

I think I may have a poor understanding of how memory management works, so forgive me if this is a silly question. the problem I'm trying to solve is that a program crashes mysteriously after running for awhile, and my guess is that I'm doing something bad with copying objects, so it fills up the stack. If I can see how much room there is over time, I can tell if that is happening.
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 436
Reputation: Chainsaw is an unknown quantity at this point 
Solved Threads: 11
Chainsaw's Avatar
Chainsaw Chainsaw is offline Offline
Unprevaricator

Re: possibly ignorant question about the stack

 
0
  #2
Sep 23rd, 2004
stack space is managed by the compiler, and usually if you have problems its becuase you recurse too deep and blow out the stack, but that's often pretty obvious.

Copying objects can cause you do do bad things with HEAP space (new/delete) if you have allocated space in the object and you don't have good copy constructors.

can you post some code?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC