[Development] qt_add/removeObject hooks
Thiago Macieira
thiago.macieira at intel.com
Tue Apr 8 16:42:46 CEST 2014
Em ter 08 abr 2014, às 15:49:16, Volker Krause escreveu:
> API-wise we are quite flexible (can't get any more dirty than what we do now
> ;) ), I was mainly asking due to this being on a performance-relevant path.
> The QInternal callback system is obviously more flexible (and thus would be
> my preferred choice), but also slightly more expensive at runtime. The
> signal spy approach would be slightly more light-weight, at the cost of
> thread-safety. So, if from the performance point of view there are no
> objections to the QInternal callback approach, I'll make sure the Squish
> team is happy with that too, and propose a patch accordingly.
Performance-wise, I'd prefer empty functions that get overridden at runtime.
That's the smallest overhead for when they are not present.
To solve the problem of the compiler optimising, we can also just write this
in assembly. You'll need to provide one .S for GCC & Clang builds and one .asm
for MSVC builds. But this way we can ensure these functions are always
exported, never optimised out, and specifically for Windows, they are long
enough so you can insert the necessary JMP by overwriting the function.
> Should this include the removal of the old add/removeObject hooks or are
> they considered public API (they are exported)?
I'd leave them around for a release or two just so both GammaRay and Squish
have the chance to update and adapt, as well as notify customers that they
will need to upgrade.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
More information about the Development
mailing list