From: Han-Wen Nienhuys Date: Thu, 4 Aug 2005 10:46:35 +0000 (+0000) Subject: (derived_mark): new method. Yes. We X-Git-Tag: release/2.7.4~25 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=237e77fa9135ba5219636ba4602c09e1026a7aba;p=lilypond.git (derived_mark): new method. Yes. We have to protect even those unlikely to be corrupted data members. --- diff --git a/ChangeLog b/ChangeLog index 322e681fef..e62c22992d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-08-04 Han-Wen Nienhuys + + * lily/auto-beam-engraver.cc (derived_mark): new method. Yes. We + have to protect even those unlikely to be corrupted data members. + 2005-08-04 Graham Percival * ly/bagpipe.ly: new file. diff --git a/THANKS b/THANKS index e670581927..62452ed903 100644 --- a/THANKS +++ b/THANKS @@ -31,7 +31,7 @@ BUG HUNTERS/SUGGESTIONS Erlend Aasland Bob Broadus - +Donald Axel Release 2.6 diff --git a/lily/auto-beam-engraver.cc b/lily/auto-beam-engraver.cc index 8cff65e02c..823f288081 100644 --- a/lily/auto-beam-engraver.cc +++ b/lily/auto-beam-engraver.cc @@ -31,7 +31,8 @@ protected: void process_music (); virtual bool try_music (Music *); virtual void finalize (); - + virtual void derived_mark () const; + DECLARE_ACKNOWLEDGER (rest); DECLARE_ACKNOWLEDGER (beam); DECLARE_ACKNOWLEDGER (bar_line); @@ -72,7 +73,7 @@ private: // We act as if beam were created, and start a grouping anyway. Beaming_info_list *grouping_; - SCM beam_settings_; // ugh. should protect ? + SCM beam_settings_; Beaming_info_list *finished_grouping_; @@ -80,6 +81,13 @@ private: }; +void +Auto_beam_engraver::derived_mark () const +{ + scm_gc_mark (beam_settings_); +} + + void Auto_beam_engraver::check_bar_property () { @@ -181,7 +189,13 @@ Auto_beam_engraver::create_beam () if (Stem::get_beam ((*stems_)[i])) return 0; - Spanner *beam = new Spanner (beam_settings_, context ()->get_grob_key ("Beam")); + /* + Can't use make_spanner_from_properties() because we have to use + beam_settings_. + */ + Spanner *beam = new Spanner (beam_settings_, + context ()->get_grob_key ("Beam")); + for (int i = 0; i < stems_->size (); i++) { Beam::add_stem (beam, (*stems_)[i]); diff --git a/lily/clef-engraver.cc b/lily/clef-engraver.cc index 629ffee80c..04603ba7b9 100644 --- a/lily/clef-engraver.cc +++ b/lily/clef-engraver.cc @@ -30,6 +30,8 @@ protected: void stop_translation_timestep (); void process_music (); DECLARE_ACKNOWLEDGER (bar_line); + + virtual void derived_mark () const; private: Item *clef_; Item *octavate_; @@ -42,6 +44,14 @@ private: void inspect_clef_properties (); }; +void +Clef_engraver::derived_mark () const +{ + scm_gc_mark (prev_octavation_); + scm_gc_mark (prev_cpos_); + scm_gc_mark (prev_glyph_); +} + Clef_engraver::Clef_engraver () { clef_ = 0; diff --git a/lily/grob-array.cc b/lily/grob-array.cc index fa8d4cd65c..2aa4ee7991 100644 --- a/lily/grob-array.cc +++ b/lily/grob-array.cc @@ -50,7 +50,7 @@ Grob_array::mark_smob (SCM s) (void) s; #if 0 - // see System::derived_mark() + // see System::derived_mark () const Grob_array *ga = unsmob_grob_array (s); for (int i = 0; i < ga->grobs_.size(); i++) scm_gc_mark (ga->grobs_[i]->self_scm ()); diff --git a/lily/hara-kiri-engraver.cc b/lily/hara-kiri-engraver.cc index 2460e0e7b7..3441b9db08 100644 --- a/lily/hara-kiri-engraver.cc +++ b/lily/hara-kiri-engraver.cc @@ -21,12 +21,18 @@ protected: DECLARE_ACKNOWLEDGER (grob); virtual void add_element (Grob *e); void start_translation_timestep (); - + virtual void derived_mark () const; SCM interesting_; public: TRANSLATOR_DECLARATIONS (Hara_kiri_engraver); }; +void +Hara_kiri_engraver::derived_mark () const +{ + scm_gc_mark (interesting_); +} + void Hara_kiri_engraver::start_translation_timestep () { diff --git a/lily/ly-module.cc b/lily/ly-module.cc index ba99e64f74..2dcdb0ffa2 100644 --- a/lily/ly-module.cc +++ b/lily/ly-module.cc @@ -162,9 +162,10 @@ make_stand_in_procs_weak () SCM old_tab = scm_stand_in_procs; SCM new_tab = scm_make_weak_key_hash_table (scm_from_int (257)); - new_tab = scm_internal_hash_fold ((Hash_closure_function) & redefine_keyval, + new_tab = scm_internal_hash_fold ((Hash_closure_function) &redefine_keyval, NULL, - new_tab, old_tab); + new_tab, + old_tab); scm_stand_in_procs = new_tab; } diff --git a/lily/stanza-number-engraver.cc b/lily/stanza-number-engraver.cc index 8dd9c16f6c..866336e224 100644 --- a/lily/stanza-number-engraver.cc +++ b/lily/stanza-number-engraver.cc @@ -13,19 +13,21 @@ class Stanza_number_engraver : public Engraver { Item *text_; - /* - This is naughty, since last_stanza_ may be GCd from under us. But - since we don't look at the contents, we are/should be (knock on - wood) OK. - */ SCM last_stanza_; public: TRANSLATOR_DECLARATIONS (Stanza_number_engraver); void process_music (); + virtual void derived_mark () const; void stop_translation_timestep (); DECLARE_ACKNOWLEDGER (lyric_syllable); }; +void +Stanza_number_engraver::derived_mark () const +{ + scm_gc_mark (last_stanza_); +} + /* TODO: should make engraver that collects all the stanzas on a higher level, and then groups them to the side. Stanza numbers should be diff --git a/lily/time-signature-engraver.cc b/lily/time-signature-engraver.cc index 1815a865e8..3ebb80672a 100644 --- a/lily/time-signature-engraver.cc +++ b/lily/time-signature-engraver.cc @@ -20,12 +20,21 @@ class Time_signature_engraver : public Engraver SCM last_time_fraction_; protected: + virtual void derived_mark () const; void stop_translation_timestep (); void process_music (); public: TRANSLATOR_DECLARATIONS (Time_signature_engraver); }; + +void +Time_signature_engraver::derived_mark () const +{ + scm_gc_mark (last_time_fraction_); +} + + Time_signature_engraver::Time_signature_engraver () { time_signature_ = 0; diff --git a/lily/volta-engraver.cc b/lily/volta-engraver.cc index 5d8b0107df..0189f1521e 100644 --- a/lily/volta-engraver.cc +++ b/lily/volta-engraver.cc @@ -32,10 +32,10 @@ protected: DECLARE_ACKNOWLEDGER (bar_line); virtual void finalize (); - + virtual void derived_mark () const; void stop_translation_timestep (); void process_music (); - + Moment started_mom_; Spanner *volta_span_; Spanner *end_volta_span_; @@ -45,6 +45,13 @@ protected: bool staff_eligible (); }; +void +Volta_engraver::derived_mark () const +{ + scm_gc_mark (staff_); + scm_gc_mark (start_string_); +} + Volta_engraver::Volta_engraver () { staff_ = SCM_EOL;