[PPL-devel] Re: To summarize [Was: Feature request: optionally compile with support for exceptions]

Kevin Ryde user42 at zip.com.au
Mon Oct 29 21:51:46 CET 2001


Roberto Bagnara <bagnara at cs.unipr.it> writes:
> 
> it looks like I was not very successful in explaining why we absolutely
> need GMP to be compiled with exception support (and, in the long run,
> to be exception-safe).

Throwing exceptions from the mp_set_memory_functions routines is not
currently supported, and probably leaks memory and leaves variables in
inconsistent states (which you mentioned before perhaps).

The situation might not quite be as bad as it seems, since all
allocations will have gone through those memory functions, so perhaps
that provides a means to clean up.  Depends on the intended use I
guess.

Exceptions from divide-by-zero or sqrt-of-negative might be more
hopeful, since those things at least can be (or ought to be) tested at
the start of relevant gmp routines.  Currently a deliberate "int"
divide-by-zero is induced, so it might work to catch SIGFPE or the
like, on those chips which raise that.



More information about the PPL-devel mailing list