This is the mail archive of the
mailing list for the Guile project.
How to make user-defined functions abortable
- To: email@example.com
- Subject: How to make user-defined functions abortable
- From: Lars Arvestad <firstname.lastname@example.org>
- Date: 19 Aug 1999 12:47:35 +0200
I have a small set of C functions that I have hooked into
Guile. Unfortunately, they allocate lots of memory and take a long
time to execute, and there are times when it would be nice to do C-c
and abort the execution. Due to the allocated memory, I need to
protect the functions in SCM_DEFER_INTS/SCM_ALLOW_INTS which blocks
the possibility of using C-c.
Can I safely set up a signal handler to catch SIGABRT and deallocate
the memory that I have claimed? I am quite inexperienced in signal
handling unfortunately, so I do not entirely understand the issues
here. Is there a simple method using libguile to do this? I am
thinking of the Guile primitives catch/throw.
Lars Arvestad Dept. of Numerical Analysis and Computing Science
Royal Institute of Technology (KTH), Stockholm, Sweden