diff options
| author | Olivier Goffart <olivier.goffart@nokia.com> | 2010-05-05 07:44:58 (GMT) | 
|---|---|---|
| committer | Olivier Goffart <olivier.goffart@nokia.com> | 2011-03-31 14:32:44 (GMT) | 
| commit | bc3491c1b85ca36486c9472ecf7ba82f46699e8a (patch) | |
| tree | d08c3752f6e0656974c18eb654811f889276366a /doc/src/snippets/code/src_script_qscriptengineagent.cpp | |
| parent | d7ee1cc6456e35823d2c470feec6219ef516e1f6 (diff) | |
| download | Qt-bc3491c1b85ca36486c9472ecf7ba82f46699e8a.zip Qt-bc3491c1b85ca36486c9472ecf7ba82f46699e8a.tar.gz Qt-bc3491c1b85ca36486c9472ecf7ba82f46699e8a.tar.bz2 | |
Speedup activation of signals
The virtual QObject::qt_metacall will recurse to the whole object hierarchy
to find from which class a function should be called.
But it is possible to know, at connection time, from which exact
QMetaObject a function belongs, and the relative offset into it.
So we make the slot calls from the qt_static_metacall function.
So activation of signals is faster.
 - We must not call a slot from a class that has been destroyed.
   To avoid this, there is a check on the methodOffset. If it is
   smaller, that means we might be called (indirectly) from
   the destructor. We fallback to the virtual call to qt_metacall
   that does the right thing.
 - The signature of the static method is void (*) (QObject*,MetaCall,int,void**)
   It returns void, so the compiler is allowed to do tail recusive
   optimization.  Having the QObject* as first parameter make it ready
   on the stack for the call to the member function.
 - The new static method has to be a member function in order to
   be able to access the private slots.
Reviewed-by: brad
Diffstat (limited to 'doc/src/snippets/code/src_script_qscriptengineagent.cpp')
0 files changed, 0 insertions, 0 deletions
