Yet another strike against the current AA implementation

Joel C. Salomon joelcsalomon at gmail.com
Wed Apr 29 07:52:53 PDT 2009


Georg Wrede wrote:
> *If* we had a convenient way to record the high-water mark of stack
> usage for functions (and maybe also threads), then people could have new
> insights on how little stack space is needed.
> 
> This would be /very/ convenient once we start using thread specific
> stacks, because the stack space has to be allocated in advance,
> hopefully not wasting huge amounts of space "just in case".

What do you mean by “thread-specific stacks”?

> Incidentally, this raises another thought: what if the stack was
> extendable? Like D arrays? A stack overflow would trigger a relocation
> of the stack, and then continue. Being able to have hundreds of small
> stacks would be useful in other things than threads, too.

How much rewriting of the stack would have to happen? Relocating the
stack will invalidate any pointers to automatic (in the C sense) variables.

Detecting stack overflow at runtime might also not be trivial.

—Joel Salomon



More information about the Digitalmars-d mailing list