Diffusion KIO 4b4981968992

Make KFileItem a Q_MOVABLE_TYPE

Authored by Frank Reininghaus <frank78ac@googlemail.com> on Jun 21 2014, 7:32 AM.

Description

Make KFileItem a Q_MOVABLE_TYPE

The motivation for this change is that this reduces the memory usage of
a QList<KFileItem> a.k.a. KFileItemList, which is used extensively in
KCoreDirLister's API and in applications, by 32 bytes per item on a
64-bit system, and that it may also improve the performance in some
situations because many memory allocations are saved.

Some changes in KCoreDirListerCache were required because this class
stores raw pointers to KFileItems and expects that these always remain
valid. To guarantee that this is the case and that the KFileItems owned
by KCoreDirListerCache do not move, a new class NonMovableFileItem is
introduced, which inherits KFileItem, but is not a Q_MOVABLE_TYPE.

A better solution would be to modify KCoreDirListerCache such that it
does not need the KFileItem pointers any more. The current solution is
meant as a temporary workaround for this problem, to make it possible
to make the binary incompatible Q_MOVABLE_TYPE change for KFileItem
before KF5 is frozen for such changes.

REVIEW: 118775

Details

Committed
Frank Reininghaus <frank78ac@googlemail.com>Jun 21 2014, 7:32 AM
Parents
R241:c91fec70b682: Revert "Do not send config reparse notification to suspended ioslaves."
Branches
Unknown
Tags
Unknown