lilypond-devel
[Top][All Lists]
Advanced

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

Re: Part_combine_iterator::derived_mark: don't abort marking prematurely


From: Han-Wen Nienhuys
Subject: Re: Part_combine_iterator::derived_mark: don't abort marking prematurely. (issue 6057044)
Date: Sun, 22 Apr 2012 08:32:04 -0300

On Wed, Apr 18, 2012 at 4:56 AM,  <address@hidden> wrote:
> Short of any protests, I think I'll be going with
>
> void
> Part_combine_iterator::derived_mark () const
> {
>  if (first_iter_)
>    scm_gc_mark (first_iter_->self_scm ());
>  if (second_iter_)
>    scm_gc_mark (second_iter_->self_scm ());
>  if (unisono_event_)
>    scm_gc_mark (unisono_event_->self_scm ());
>  if (mmrest_event_)
>    scm_gc_mark (mmrest_event_->self_scm ());
>  if (solo_one_event_)
>    scm_gc_mark (solo_one_event_->self_scm ());
>  if (solo_two_event_)
>    scm_gc_mark (solo_two_event_->self_scm ());
> }
>
> All the rest is too smart for its own good.

FYI,  my experience is that writing this type of code involves cut &
paste, and it is easy to make errors like

 if (some_new_event_)
   mark(the_event_i_copied_it_from_)

I agree that 4 is borderline small enough not to use a loop.

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



reply via email to

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