lilypond-devel
[Top][All Lists]
Advanced

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

Re: GC and simple smobs??


From: David Kastrup
Subject: Re: GC and simple smobs??
Date: Fri, 17 Jun 2022 23:49:14 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

Jean Abou Samra <jean@abou-samra.fr> writes:

> By the way, I have a side question. Suppose I have determined
> that I need to mark the local variable scm_obj with
> scm_remember_upto_here in this code:
>
> SCM scm_obj = get_it_from_somewhere ();
>
> return something_that_needs_scm_obj_alive;
>
> // Is this correct?
> scm_remember_upto_here (scm_obj);
>
>
> Might the compiler detect that return exits the function and
> ignore the scm_remember_upto_here?

return; releases the stack frame.  "return
something_that_needs_scm_obj_alive;" is not a valid pattern unless the
returned value itself is an SCM that will cover scm_obj in its GC scope.

-- 
David Kastrup



reply via email to

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