digitalmars.D - Tango and setjmp.
- zz (6/6) Jan 18 2007 Will tango also implement setjmp for D.
- Daniel Keep (6/15) Jan 18 2007 You might want to take a look at StackThreads.
- Sean Kelly (9/12) Jan 19 2007 In a manner of speaking. DMC's setjmp implementation currently doesn't
Will tango also implement setjmp for D. Very many lib's in C out there (including ours use TRY CATCH macros with setjmp and longjmp for exception handling in C. And does anyone know of a simple way to wrap up such libraries so that D's exception could be used instead? Zz
Jan 18 2007
zz wrote:Will tango also implement setjmp for D. Very many lib's in C out there (including ours use TRY CATCH macros with setjmp and longjmp for exception handling in C. And does anyone know of a simple way to wrap up such libraries so that D's exception could be used instead? ZzYou might want to take a look at StackThreads. (http://assertfalse.com/projects.shtml). I'm not sure if it uses setjmp and longjump, but I know *something*'s going on in there. As for Tango: no idea :) -- Daniel
Jan 18 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
Jan 19 2007