From b542997680bb2d95c3a03a77468b67e04d30685f Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Thu, 15 Jun 2000 19:27:41 +0200 Subject: [PATCH] patch::: 1.3.59.uu2.jcn1 1.3.59.uu2.jcn1 =============== * Fixed scm_un/protect_object for guile-1.3.4 and 1.3.5 snapshots, in the process reduced number of protect/unprotect calls. With guile-1.3.5 snapshot, memory usage has decreased by 1/5th, now just 10% above the 1.2 level. Also, Lily's a bit faster. * Fixed make diff bug in stepmake to be able to make this diff :-) --- CHANGES | 10 ++++++++++ VERSION | 2 +- lily/include/identifier.hh | 1 + lily/include/moment.hh | 2 +- lily/paper-column.cc | 3 +-- lily/scm-hash.cc | 1 - lily/scope.cc | 3 +-- lily/score-element.cc | 3 +++ lily/spacing-engraver.cc | 7 ++----- lily/timing-translator.cc | 19 +++++++------------ stepmake/bin/package-diff.py | 2 +- stepmake/bin/packagepython.py | 7 +++---- 12 files changed, 31 insertions(+), 29 deletions(-) diff --git a/CHANGES b/CHANGES index 7018720bb3..c66b9458b9 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,13 @@ +1.3.59.uu2.jcn1 +=============== + +* Fixed scm_un/protect_object for guile-1.3.4 and 1.3.5 snapshots, + in the process reduced number of protect/unprotect calls. With + guile-1.3.5 snapshot, memory usage has decreased by 1/5th, now + just 10% above the 1.2 level. Also, Lily's a bit faster. + +* Fixed make diff bug in stepmake to be able to make this diff :-) + 1.3.59.hwn1 =========== diff --git a/VERSION b/VERSION index 38595325ea..eb96155196 100644 --- a/VERSION +++ b/VERSION @@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 PATCH_LEVEL=59 -MY_PATCH_LEVEL=uu2 +MY_PATCH_LEVEL=uu2.jcn1 # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/lily/include/identifier.hh b/lily/include/identifier.hh index 718d93d4d0..f6f129d493 100644 --- a/lily/include/identifier.hh +++ b/lily/include/identifier.hh @@ -99,6 +99,7 @@ DECLARE_ID_CLASS(Paper_def); DECLARE_ID_CLASS(Midi_def); Identifier * unsmob_identifier (SCM); +SCM smobify (Identifier*); #endif // IDENTIFIER_HH diff --git a/lily/include/moment.hh b/lily/include/moment.hh index 615928a62c..ae6dc6f8ce 100644 --- a/lily/include/moment.hh +++ b/lily/include/moment.hh @@ -27,7 +27,7 @@ struct Moment : public Rational DECLARE_SMOBS; }; - +SCM smobify (Moment*); Moment * unsmob_moment (SCM); IMPLEMENT_ARITHMETIC_OPERATOR (Moment, / ); diff --git a/lily/paper-column.cc b/lily/paper-column.cc index d38687e4f1..5ab553257f 100644 --- a/lily/paper-column.cc +++ b/lily/paper-column.cc @@ -97,8 +97,7 @@ Paper_column::column_l () const Paper_column::Paper_column (Moment w) : Item (SCM_EOL) // guh.? { - SCM when = (new Moment (w))->smobify_self (); - scm_unprotect_object (when); + SCM when = smobify (new Moment (w)); set_elt_property ("when", when); Axis_group_interface (this).set_interface (); diff --git a/lily/scm-hash.cc b/lily/scm-hash.cc index 08f90c5aa0..98c430b3eb 100644 --- a/lily/scm-hash.cc +++ b/lily/scm-hash.cc @@ -97,7 +97,6 @@ void Scheme_hash_table::set (SCM k, SCM v) { (*this)[k] = v; - scm_unprotect_object (v); } // UGH. diff --git a/lily/scope.cc b/lily/scope.cc index 88056b9b8b..4a27d3ce46 100644 --- a/lily/scope.cc +++ b/lily/scope.cc @@ -62,8 +62,7 @@ Scope::elem (String s)const void Scope::set (String s, Identifier * id) { - return id_dict_->set (ly_symbol2scm (s.ch_C()), - id->smobify_self()); + return id_dict_->set (ly_symbol2scm (s.ch_C()), smobify (id)); } SCM diff --git a/lily/score-element.cc b/lily/score-element.cc index 327cffe787..f54699f630 100644 --- a/lily/score-element.cc +++ b/lily/score-element.cc @@ -89,6 +89,9 @@ Score_element::Score_element (Score_element const&s) Score_element::~Score_element() { + // this goes awry when score-elements are copied... + // real weird Paper_column::~Paper_column () -> infinity_mom + // unsmobify_self (); } diff --git a/lily/spacing-engraver.cc b/lily/spacing-engraver.cc index 5e05094bdb..8146b72676 100644 --- a/lily/spacing-engraver.cc +++ b/lily/spacing-engraver.cc @@ -97,12 +97,9 @@ Spacing_engraver::do_pre_move_processing () Paper_column * sc = dynamic_cast (get_staff_info ().musical_pcol_l ()); - SCM sh = (new Moment (shortest_playing))->smobify_self (); - SCM st = (new Moment (starter))->smobify_self (); + SCM sh = smobify (new Moment (shortest_playing)); + SCM st = smobify (new Moment (starter)); - scm_unprotect_object (st); - scm_unprotect_object (sh); - sc->set_elt_property ("shortest-playing-duration", sh); sc->set_elt_property ("shortest-starter-duration", st); } diff --git a/lily/timing-translator.cc b/lily/timing-translator.cc index 9cec28f42b..74efa874af 100644 --- a/lily/timing-translator.cc +++ b/lily/timing-translator.cc @@ -79,7 +79,7 @@ Timing_translator::do_process_music() measure_position ().str ())); // resync daddy_trans_l_->set_property("measurePosition", - (new Moment)->smobify_self ()); + smobify (new Moment)); } } @@ -124,12 +124,9 @@ Timing_translator::do_creation_processing() { daddy_trans_l_->set_property ("timing" , SCM_BOOL_T); daddy_trans_l_->set_property ("currentBarNumber" , gh_int2scm (1)); - daddy_trans_l_->set_property("measurePosition", - (new Moment)->smobify_self()); - daddy_trans_l_->set_property ("oneBeat", - (new Moment (1,4))->smobify_self ()); - daddy_trans_l_->set_property("measureLength", - (new Moment (1))->smobify_self()); + daddy_trans_l_->set_property ("measurePosition", smobify (new Moment)); + daddy_trans_l_->set_property ("oneBeat", smobify (new Moment (1,4))); + daddy_trans_l_->set_property ("measureLength", smobify (new Moment (1))); } Moment @@ -160,10 +157,8 @@ Timing_translator::set_time_signature (int l, int o) { Moment one_beat = Moment (1)/Moment (o); Moment len = Moment (l) * one_beat; - daddy_trans_l_->set_property ("measureLength", - (new Moment (len))->smobify_self ()); - daddy_trans_l_->set_property ("beatLength", - (new Moment (one_beat))->smobify_self ()); + daddy_trans_l_->set_property ("measureLength", smobify (new Moment (len))); + daddy_trans_l_->set_property ("beatLength", smobify (new Moment (one_beat))); } Timing_translator::Timing_translator() @@ -219,7 +214,7 @@ Timing_translator::do_post_move_processing() else { measposp = new Moment; - daddy_trans_l_->set_property ("measurePosition", measposp->smobify_self ()); + daddy_trans_l_->set_property ("measurePosition", smobify (measposp)); } *measposp += dt; diff --git a/stepmake/bin/package-diff.py b/stepmake/bin/package-diff.py index b1fe324985..98fcbfe64b 100644 --- a/stepmake/bin/package-diff.py +++ b/stepmake/bin/package-diff.py @@ -257,7 +257,7 @@ if to_diff == from_diff: elif to_src: to_diff = to_diff + '.src' else: - sys.stderr.write (name + ': nothing to do: to == from == ' + from_diff + '\n') + sys.stderr.write (patch_name + ': nothing to do: to == from = ' + from_diff + '\n') sys.exit (1) if not patch_name: diff --git a/stepmake/bin/packagepython.py b/stepmake/bin/packagepython.py index 1950f56935..10ab9a8065 100755 --- a/stepmake/bin/packagepython.py +++ b/stepmake/bin/packagepython.py @@ -121,10 +121,9 @@ def version_tuple_to_str(tup): def version_str_to_tuple(str): t = string.split(str, '.') - try: - mypatch = t[3] - except IndexError: - mypatch = '' + mypatch = '' + if len (t) >= 4: + mypatch = string.join (t[3:], '.') return (string.atoi(t[0]), string.atoi(t[1]), string.atoi(t[2]), mypatch) def version_compare (tupl, tupr): -- 2.39.2