[clean-list] About abstract synonym types...

John van Groningen johnvg@cs.kun.nl
Thu, 5 Feb 2004 13:08:31 +0100


Erik Zuurbier wrote:

>...
>I would also like some more explanations of the new features advertised, such as the stack checks without overheads.

To detect stack overflows the compiler used to generate extra code
that compares a stack pointer to the end of the stack when
something is pushed on a stack. In Clean 2.1 this is no longer
necessary, except for MacOS classic, and unfortunately also for
MacOS X 10.3 (but not for older MacOS X systems). We have fixed this
problem for MacOS X 10.3 using MachO executables, but not yet for PEF.

This is implemented by protecting the memory pages at the end of the stacks
and installing an exception handler. If this protected memory is accessed,
the exception handler is called, and if the address matches the protected
memory at the end of the stack, the program counter and stack pointer
are modified so that a stack overflow error will be reported, with a stack
trace if possible.

Regards,

John van Groningen