lilypond-devel
[Top][All Lists]
Advanced

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

Re: #{ $music #}


From: Han-Wen Nienhuys
Subject: Re: #{ $music #}
Date: Sat, 15 May 2004 00:45:13 +0200

address@hidden writes:
> Fri, 14 May 2004 09:03:33 +0200, Han-Wen a dit : 
> 
>  > address@hidden writes:
>  >> +LY_DEFINE (ly_clone_parser, "ly:clone-parser",
>  >> +           1, 0, 0, 
>  >> +           (SCM parser_smob),
>  >> +           "Return a clone of PARSER_SMOB.")
>  >> +{
>  >> +  My_lily_parser *parser = unsmob_my_lily_parser (parser_smob);
>  >> +  My_lily_parser *clone = new My_lily_parser (*parser);
>  >> +  return clone->self_scm ();
>  >> +}
> 
>  > nitpick: you should do
> 
>  >   return scm_gc_unprotect_object (clone->self_scm ());
> 
> OK. I've seen several occurences of this pattern in the source code,
> but wasn't sure of what it meant, for I didn't find the definition of
> scm_gc_unprotect_object in the guile reference manual. Does it means
> that the object is made garbage-collectable? (for an unknown reason my

Yes. The protection is necessary because the C++ object is not
referenced as an SCM from the C++ stack.

> 
> nicolas
> 

-- 

 Han-Wen Nienhuys   |   address@hidden   |   http://www.xs4all.nl/~hanwen 





reply via email to

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