Tango and setjmp.

Sean Kelly sean at f4.ca
Fri Jan 19 00:30:41 PST 2007


zz wrote:
> Will tango also implement setjmp for D.

In a manner of speaking.  DMC's setjmp implementation currently doesn't 
work with DMD so I've decided to only make it available for Posix. 
Also, setjmp is generally just a bad idea because it can bypass stack 
unrolling so its use is somewhat discouraged.

> And does anyone know of a simple way to wrap up such libraries so that 
> D's exception could be used instead?

Any time you actually want to transfer execution up the stack you should 
throw an exception instead.  Tango uses setjmp only as a failover option 
for stack threads.


Sean



More information about the Digitalmars-d mailing list