KDevVarLengthArray still required?

Milian Wolff mail at milianw.de
Fri Jan 15 21:21:24 UTC 2010


On Friday 15 January 2010 21:55:09 David Nolden wrote:
> Am Dienstag 12 Januar 2010 23:38:27 schrieb Milian Wolff:
> > I thought mem-pools could use many blocks of a given size, i.e. exactly
> > the difference? I mean malloc/realloc takes one sequential chunk of
> > memory of requested size, no? And with a pool, when one needs more
> > space, one can
> > 
> >  simple add a block and store the stuff there instead of realloc'ing all
> >  the existing stuff. Or am I mixing things up?
> 
> Well yes, that can be done. But I don't believe all that stuff makes a very
> big difference in comparison to the one-block case.

I read this once: 
http://www.boost.org/doc/libs/1_41_0/libs/pool/doc/concepts.html

And I got my impression from there. And (imo) alone the fact that realloc 
requires a chunk of memory to be consecutive (i.e. must not be fragmented) is 
a big downside. Even if there is lots of free memory one could come into the 
situation where there is not a block of that size, no? Or does the 
memcontroller / kernel cover these cases? Also imagine where filesystems would 
be nowadays if they would not support fragmented files ;-)

And as my callgrinds show: 1.1k reallocs cause 3.5 mio 
IndexedQualifiedIdentifier ctor & dtor calls, which is > 70% of the total calls 
to the copy-ctor and 41% of the calls to the dtor _overall_... And both ctor & 
dtor have a pretty high "incl" cost... (11.72% & 19.31%)

See also:
http://users.physik.fu-berlin.de/~milianw/callgrind.out.29477.bz2
-- 
Milian Wolff
mail at milianw.de
http://milianw.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20100115/28f7379f/attachment.sig>


More information about the KDevelop-devel mailing list