bug-lilypond
[Top][All Lists]
Advanced

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

Re: Issue 1475 in lilypond: crash with many markups between scores


From: David Kastrup
Subject: Re: Issue 1475 in lilypond: crash with many markups between scores
Date: Thu, 20 Jan 2011 19:46:47 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

address@hidden writes:

> By the way, the excessive memory usage was in
> Page_breaking::line_divisions_rec. This function theoretically uses
> memory which is exponential in the number of systems, but it should
> never be an issue because of the way the function is used; the
> lower_bound and upper_bound arguments keep memory usage down to
> something linear in the number of systems. The problem was that I
> changed the way that systems were counted internally in the page
> breaker (before, system_count() counted systems, titles and markups,
> but I changed it to only count systems). But I didn't make the change
> in all of the places where it was required, so the system_count
> argument to line_divisions_rec got out of sync with the lower_bound
> and upper_bound arguments, causing exponential memory usage (but only
> when there are enough titles and markups to make things sufficiently
> out of sync).

I have not looked at the code, but this sounds like an accident waiting
to happen again and/or like being hard to read.  Would there be a
feasible way to reduce the place where the actual updating is being done
to _one_ location (like an inline private member function or whatever
else) instead of needing to cater with continuing having to do maintain
any further "change in all of the places where it was required"?

-- 
David Kastrup




reply via email to

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