On Thursday 17 July 2014 12:20:56 Olivier Goffart wrote: > But Qt don't use custom allocators. According to grep, the only place where > "operator new" is used directly in Qt is QSharedPointer[2]. And I believe > it is better to change the code to call the normal new. (I'm not sure why > it's done this way.)
Because we need to split the memory allocation from the initialisation of the object. The memory is allocated for the object plus the 16 bytes required for the QSharedPointer internal data in one go. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center _______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development