Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.11.2
-
None
Description
I have taken a closer look at the available information for the QList class once more.
Documentation:
“…, where QList<T> will allocate its items on the heap unless sizeof(T) <= sizeof(void*) …”
I would expect that all items will be put on the heap because items for stack storage should have got a fixed size. But this class belongs to the category of enlargeable data structures. (A bit of fixed management data can eventually be stored on the stack.)
The current source code contains the following information.
… struct MemoryLayout … QTypeInfo<T>::isStatic || QTypeInfo<T>::isLarge, QListData::IndirectLayout, typename std::conditional< sizeof(T) == sizeof(void*), QListData::ArrayCompatibleLayout, QListData::InlineWithPaddingLayout >::type>::type {}; …