KDevVarLengthArray: memmove / memcopy?

Milian Wolff mail at milianw.de
Fri Jun 24 10:38:09 UTC 2011


On Friday 24 June 2011 11:41:28 David Nolden wrote:
> QVarLengthArray is missing the convenience-functions to make it usable
> as a drop-in replacement for other containers (for example indexOf or
> similar), so we'll stay with KDevVarLengthArray. Otherwise hundreds of
> uses would have to become significantly uglier (we had it before
> adding KDevVarLengthArray). The crash-bug in QVarLengthArray which was
> the main motiviation to add KDevVarLengthArray may have been fixed in
> the meantime though.

Ah, actually good that you remember me of that. Now that we depend on Qt 4.6 
(we do, don't we?) I'll try to make KDevVarLengthArray subclass 
QVarLengthArray and add the convenience-functions that way. The crash-bug 
should be fixed in 4.6 according to the comment I added when I investigated 
last time.

> Regarding memmove:
> KDevVarLenghtArray is usually used for short arrays, and if the array
> contains only 3 items, then the function-call to memmove would be a
> significant overhead. Also, I would be very careful with the
> moving-code, because it is very fragile and bug-prone.

There are a few arrays which start with a size of 256 but I agree with you 
that it's probably not worth it, esp. considering the fragile/bug-prone nature 
and the comments from Syron.

It was just an idea anyways, thanks for clearing it up all!

bye
-- 
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/20110624/4c281c4d/attachment.sig>


More information about the KDevelop-devel mailing list