[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lilypond segfaulting
From: |
Han-Wen |
Subject: |
Re: lilypond segfaulting |
Date: |
Sat, 29 Jun 2002 16:15:38 +0200 |
address@hidden writes:
> Thanks for reporting this bug. The problem in your example file is that
> staffAglobal creates an ambitus grob of its own (which does not get
> properly initialized and therefore crahses), competing with the one
> resulting from staffAlayerA (silly me!). I will try to get this fixed
> until the end of this week. I beg your pardon!
I have a nitpick:
Pitch pitch = *unsmob_pitch (nr->get_mus_property ("pitch"));
if (Pitch::compare (pitch_min, pitch_max) > 0) // already init'd?
{
// not yet init'd; use current pitch to init min/max
pitch_min = pitch;
pitch_max = pitch;
ambitus_p_->set_grob_property ("pitch-min",
pitch_min.smobbed_copy ());
ambitus_p_->set_grob_property ("pitch-max",
pitch_max.smobbed_copy ());
}
else if (Pitch::compare (pitch, pitch_max) > 0) // new max?
{
pitch_max = pitch;
ambitus_p_->set_grob_property ("pitch-max",
pitch_max.smobbed_copy ());
}
else if (Pitch::compare (pitch, pitch_min) < 0) // new min?
{
pitch_min = pitch;
ambitus_p_->set_grob_property ("pitch-min",
pitch_min.smobbed_copy ());
}
}
for every note head, a new pitch smob is put into
pitch-{min,max}. That is wasteful. It is more efficient to postpone
writing ambitus_p_->set_grob_property() to
Ambitus_engraver::finalize(). This creates less garbage
--
Han-Wen Nienhuys | address@hidden | http://www.cs.uu.nl/~hanwen