On 01/08/2009 23:45, Jean-Marc Lasgouttes wrote:
Le 01/08/2009 18:29, Abdelrazak Younes a écrit :
In case this question was left unanswered, we don't want a buffer_
member in InsetMathChar because this sucks 4 bytes of memory for each
inset. And, AFAICS, there's no need to access the Buffer in an
InsetMathChar.

First, removing a setBuffer method does not change the fact that Inset has a buffer_ member.

I didn't know that Inset had a buffer_ member...


Moreover, as Vincent the buffer_ member will probably come handy when
we have change tracking in math.

I think CT can (and probably should) be handled in a higher level inset.


How much memory does an InsetMathChar use these days?
Right now:

From Inset:
Buffer_ * buffer  -> 4 bytes

In InsetMathChar :
/// the character
char_type char_;   -> 4 bytes
/// cached kerning for superscript
mutable int kerning_;   -> 4 bytes

That makes 12 bytes. char_ ought to stay of course but I don't know why kerning_ is still there...


The fact that this member was added by andré, who was also the keeper
of Inset virginity (in some way :) tells me that the problem may not
really exist.

It just tells me that André did this change as a stop gap measure and he forgot (or did not bothered) to clean it up afterward :-)

All I did was to push forward the logic of a change that
was only half done. I think that having access to the inset buffer is a
great win, especially for inset layouts

Oh, I do not discuss that change, I am merely explaining why we didn't want a Buffer pointer in *all* insets.

Abdel.

Reply via email to