[ODE] Stack overflow

Nate W coding at natew.com
Thu Jan 30 22:47:02 2003


On Thu, 30 Jan 2003, Gary R. Van Sickle wrote:

> > Alternately, you could declare your own alloca() and write your own memory
> > manager. [...]
> 
> Couldn't std::stack<> come to the rescue here?

I'm sure it would work, but would it be fast?

Does std::stack allocate a giant chunk of memory and then sub-allocate
from that in stack-like fashion or does each object in the std::stack get
allocated from the heap?  The former would probably be pretty fast, but
the latter would be no faster than malloc().

-- 

Nate Waddoups
Redmond WA USA
http://www.natew.com