diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2019-09-04 19:30:08 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2019-09-05 15:40:40 +0000 |
commit | 236d4637b2258def1e678e515b42632943eb888d (patch) | |
tree | 7f8bb2e868932c3a7bcfa656ef1f7249b1f012b4 /src/gui/painting/qdrawhelper.cpp | |
parent | 6f4bc3942dda076eedf38d8c8604eb4fa5d7bd3b (diff) |
Optimize QEventDispatcherWinRT::runOnMainThread()
- use std::make_shared instead of QSharedPointer
- two memory allocations saved
- co-locate semaphore and HRESULT object in a single State object
- one more memory allocation saved
- pass the shared_ptr<State> by value into the runnable
- two more memory allocations saved
Not only is the new code much faster, it's also much more readable.
Also use QSemaphoreReleaser, just in case the delegate should throw.
Change-Id: Ib99b9da86984d440d10b72e3071aa88099e24a1f
Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/gui/painting/qdrawhelper.cpp')
0 files changed, 0 insertions, 0 deletions