Re: Guile GC in C++

2021-07-06 Thread David Kastrup
Jonas Hahnfeld writes: > Am Dienstag, dem 06.07.2021 um 17:03 +0200 schrieb David Kastrup: >> Jean Abou Samra writes: >> >> > For example, if I were the author of the below code, how >> > would I understand that the mmrest_event_ should be >> > unprotected? >> > >> > void >> > Part_co

Re: Guile GC in C++

2021-07-06 Thread Jonas Hahnfeld via Discussions on LilyPond development
Am Dienstag, dem 06.07.2021 um 17:03 +0200 schrieb David Kastrup: > Jean Abou Samra writes: > > > For example, if I were the author of the below code, how > > would I understand that the mmrest_event_ should be > > unprotected? > > > > void > > Part_combine_iterator::kill_mmrest (Contex

Re: Guile GC in C++

2021-07-06 Thread David Kastrup
Jean Abou Samra writes: > For example, if I were the author of the below code, how > would I understand that the mmrest_event_ should be > unprotected? > > void > Part_combine_iterator::kill_mmrest (Context *c) > { > if (!mmrest_event_) > { > mmrest_event_ = new Stream_event >

Re: Guile GC in C++

2021-07-06 Thread Jean Abou Samra
Le 06/07/2021 10:59, David Kastrup <[1]d...@gnu.org> a écrit : Jean Abou Samra <[2]j...@abou-samra.fr> writes: Hello, I am struggling to understand how to write C++ code that correctly protects and unprotects smobs from GC. Take this code from lily/grob-pq-engraver.cc: vo

Re: Guile GC in C++

2021-07-06 Thread David Kastrup
Jean Abou Samra writes: > Hello, > > I am struggling to understand how to write > C++ code that correctly protects and unprotects > smobs from GC. Take this code from lily/grob-pq-engraver.cc: > > void > Grob_pq_engraver::process_acknowledged () > { > std::sort (started_now_.begin (), started_n

Guile GC in C++

2021-07-06 Thread Jean Abou Samra
Hello, I am struggling to understand how to write C++ code that correctly protects and unprotects smobs from GC. Take this code from lily/grob-pq-engraver.cc: void Grob_pq_engraver::process_acknowledged () { std::sort (started_now_.begin (), started_now_.end ()); SCM lst = SCM_EOL; SCM *tai