The maximum size of newQuads is known in advance, so we can avoid
unnecessary reallocations when adding transformed window quads to
newQuads.
Details
Details
- Reviewers
davidedmundson - Group Reviewers
KWin - Commits
- R108:4aa19c2e9189: [effects/magiclamp] Eliminate unnecessary reallocations
Minimized/unminimized System Settings.
Diff Detail
Diff Detail
- Repository
- R108 KWin
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Comment Actions
If this is an issue, we could try looking into setting a Q_DECLARE_TYPEINFO on the WindowQuadList.
Right now QList still allocates a second set of memory for complex types separate from the internal void* list that we're pre-allocating here.
Comment Actions
sizeof(WindowQuad) is greater than sizeof(void*), so I'm not sure whether that will help.
In this case, I think the right way would be to use QVector.