Lior Silberman <[EMAIL PROTECTED]> writes:
| What about using different values in different contexts - table cells
| usually have less text than run-of-the-mill paragraphs. Add an extra
| constr. to LyXParagraph getting an 'enum ExpectedSize' value (Tiny, Small,
| ...) and reserve memory accordingly.
I'd rather just remove it instead of complicating the api even
further.
|
| About copying paragraphs for 'Undo' purposes, if this were done using a
| copy constructor and not a 'Clone', it would be easy to reserve exactly
| the amount of memory needed.
Clone could do this too.
| Also, note that on my machine (i686 Linux, g++) sizeof(LyXParagraph) == 232,
| and this does not count dynamic memory allocated by the other vectors inside,
| or by the cell insets outside.
I have several plans for reducing the size of LyXParagraph:
- move specialized variables to appropriate insets
- create a ref counted parparams class
| Thus the reserved text buffer accounts for less than 2/3 of the memory
| use. Not to say that we shouldn't reduce it, but perhaps we can find some
| ways to save more space. E.g. not allocate anything until the user
| actually puts something in the cell.
This should be done in the InsetTabuler/Tabular.
Lgb