[augeas-devel] Label and value index of tree node

David Lutterkort lutter at redhat.com
Mon Oct 18 22:48:34 UTC 2010


On Sat, 2010-10-16 at 11:08 -0400, Francis Giraldeau wrote:
> Le jeudi 14 octobre 2010 à 11:14 -0700, David Lutterkort a écrit : 
> > On Mon, 2010-10-04 at 08:37 -0400, Francis Giraldeau wrote:
> > 
> > The one thing that makes me a little hesitant committing this right away
> > is that it increases the size of a tree node from 48 bytes to 64 bytes
> > (and possibly more) for every user of Augeas, even though most of them
> > won't make use of the position information.
> > 
> > Moving position information into a separate struct would lower the
> > impact somewhat for people that do not need position information, since
> > we'd just not allocate position information for them. Your strategy for
> > memory management sounds right, the position information should live
> > exactly as long as the struct tree.
> 
> So, we could add an option to keep node positions, and allocate the
> structs only on demand? 

Yes, I think that would be best to balance the needs of UI and non-UI
users of the API, even if (as your experiments show) the change only
increases memory by 5%.

Ideally, we'd make this a new flag that is passed to aug_init.

David





More information about the augeas-devel mailing list