lilypond-devel
[Top][All Lists]
Advanced

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

Re: Quick question about grob interfaces


From: Han-Wen Nienhuys
Subject: Re: Quick question about grob interfaces
Date: Fri, 27 Jul 2018 23:21:37 +0200

On Fri, Jul 27, 2018 at 10:45 AM David Kastrup <address@hidden> wrote:

>
> > The grob-interfaces are a means to group certain functionality (and
> > respective properties.). Whether it's OK for two separate pieces code to
> > both use the same property depends on the specific case.  I suspect this
> > reuse happens a lot for generic properties such as #'dir (or was it
> called
> > #'direction?).
> >
> > That said, I don't fully understand your question. What do you want to
> do?
>
> Basically put all properties of a grob into a vector with fixed
> positions.  Treating each interface as one block could be interesting
> from a C++ implementation standpoint but if multiple interfaces used in
> the same grob can contain the same property, that's not really an option
> since virtual inheritance from every single property (rather than
> interfaces) would be a nightmare
>

A vector seems wasteful of memory to me, and hard to make work.

one option is that could avoid the allocations here

https://github.com/lilypond/lilypond/blob/de27422214f61101b306c25213ab34d1fd7c3474/lily/break-substitution.cc#L125

is to use type information of properties, ie. annotate each property with
info as to whether it can contain grob pointers. If not, there is no need
to recurse into the property.

It's risky though, because it will be impossible to enforce that people
obey rules about what kind of things can be stored in what property.


like governing enough of LilyPond's core time and memory needs for large
> scores that restructuring the data accordingly from the current quite
> alist-based approach does not seem amiss.  I'm just trying to figure out
> how to best wire the C++ parts of that.
>

IIRC, the expensive parts is rearranging long lists of grobs (eg. splitting
the grobs attached to a system spanner into the post-linebreak system
spanners.

It's not clear to me how the alist per se is a problem and how
restructuring could fix that.


>
> --
> David Kastrup
>


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


reply via email to

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