[Interest] QObject, PIMPL and overloading operator new

Peter Koek peter_koek at hotmail.com
Fri Aug 16 11:34:39 CEST 2013


Suppose that I have objects deriving from QObject and want to control their dynamic allocations for performance reasons. I would overload operator new to allocate them, for example, into a pool. None of this is implemented in any way yet.The objects themselves would now be allocated in the pool. However, since I didn't overload the operator new of QObjectPrivate it would not be allocated into the pool which partly defeats the purpose, as I still have a default allocation.My question is: can I control the way the private parts of Qt (specifically, QObjectPrivate) are allocated?I'd also like to verify the following statements in the context of an LGPL license. I'd like to keep my source closed, so modifying the Qt source directly is not possible. I'd also rather not derive my own PIMPL object from QObjectPrivate to overload operator new, as it would destroy binary compatibility with future versions of Qt5, even when not using any of the QObjectPrivate members. 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130816/a3d3a746/attachment.html>


More information about the Interest mailing list