emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Calling Lisp in C functions


From: Eli Zaretskii
Subject: Re: Calling Lisp in C functions
Date: Wed, 22 Sep 2021 08:45:48 +0300

> From: Yuan Fu <casouri@gmail.com>
> Date: Tue, 21 Sep 2021 12:38:21 -0700
> 
> What’s the best way to evaluate Lisp or call a Lisp function that could 
> signal in a C function and then free allocated memory? I assume that I can’t 
> just call the Lisp function and hope it doesn’t signal.

You want to catch the errors in Lisp that you call from C?  If so, use
the safe_call functions we already have.

If all you want is make sure memory will be allocated, but don't mind
if the signal thrown by Lisp gets back to command loop, use
record_unwind_protect to register a function which will release the
memory.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]