Mail Archives: djgpp/1999/12/13/08:13:46
On Sun, 12 Dec 1999, Martin Peach wrote:
> I think that recursion can be dangerous because of the possibility of stack
> overflow, which is a weak spot in most computer architectures, in that the
> cpu blindly allocates memory to the stack without first checking to see if
> it is available
This can be handled by using the stackavail library function. It's
non-portable, though.
> An architecture that uses a separate memory space for the
> stack would be preferable, but that doesn't seem to be in the works
Actually, it's quite possible to make the stack be overflow-protected,
by defining a separate, expand-down segment for it. This is actually
how DJGPP v1.x worked. However, the downside was that
-fomit-frame-pointer didn't work, so v2.x stopped using that model.
Unfortunately, setting up stack overflow protection without losing
-fomit-frame-pointer is such a pain in the DPMI environment, that
nobody had enough motivation to make it happen.
- Raw text -