summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
Commit message (Collapse)AuthorAgeFilesLines
* Fix race condition in QThread::setPriorityDavid Faure2013-03-234-41/+42
| | | | | | | | | | | | | The value of priority was read without the mutex locked, from within the thread. Had to extract a QThreadPrivate::setPriority method so that it can be called with the mutex already locked. So if the main thread calls setPriority while the thread is starting, it will be either be before or after the "re-set priority" code at thread startup, but at least not in the middle of it. Change-Id: I7a054f68623f61482c749274da66f3b2dcd8bcee Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QThread: fix race when setting the eventDispatcherDavid Faure2013-03-224-15/+18
| | | | | | | Use QAtomicPointer to make this thread-safe. Change-Id: If71f204699fcefabdb59bd26342d777d1cc9e2a7 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QThreadDataPrivate: fix data race on canWait boolean.David Faure2013-03-221-0/+6
| | | | | | | | postEvent() accesses it with the postEventList mutex locked, but processEvent() was checking it without any mutex locked. Change-Id: I31bbb50f7a1c337067b8e3de16ee7cd11400b517 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-1612-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* simplify/fix QT_BOOTSTRAPPED-related #ifdefsOswald Buddenhagen2013-03-141-1/+1
| | | | | | | | | | don't test for building specific tools when we actually only want to know whether we are bootstrapping. so far, this was only redundant; with the upcoming change of not bootstrapping unnecessarily it would be outright broken. Change-Id: I7600d8ebb14a4194640c50035e35a04263f2ccce Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Distinguish between 'mac' and 'macx' qmake scopesTor Arne Vestbø2013-03-051-1/+1
| | | | | | | | | | | | | | The former applies both on Mac OS X and iOS, but 'macx' is specific to Mac OS X. ios.conf and macx.conf now share most of their settings in the common mac.conf. We set the default QMAKE_MAC_SDK before loading mac.conf, so that any overrides in the device config will apply afterwards. This means configure's mkspec parsing will be able to read the QMAKE_MAC_SDK. Change-Id: I0c7e26a6a0103e19b23ef152aa9e4ab461cee632 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* Clear the current thread data for the main threadThiago Macieira2013-03-054-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | This avoids crashes accessing deleted memory when creating a QObject after the last QObject had been deleted, like a qDebug() in global destructors. ==41000== Invalid read of size 4 ==41000== at 0x5F01ED5: bool QBasicAtomicOps<4>::ref<int>(int&) (qatomic_x86.h:208) ==41000== by 0x5F01309: QBasicAtomicInteger<int>::ref() (qbasicatomic.h:147) ==41000== by 0x5F24051: QThreadData::ref() (qthread.cpp:100) ==41000== by 0x614A984: QObject::QObject(QObject*) (qobject.cpp:681) ==41000== Address 0x6ee73f0 is 0 bytes inside a block of size 152 free'd ==41000== at 0x4A0736C: operator delete(void*) (vg_replace_malloc.c:480) ==41000== by 0x5F240BF: QThreadData::deref() (qthread.cpp:109) ==41000== by 0x6113F6B: QCoreApplicationData::~QCoreApplicationData() (qcoreapplication.cpp:268) The comment right above the change in qthread.cpp looks eerily similar to the problem I'm trying to fix. However, the actual change that introduced the change is not in the Qt public history, so we can't know for sure what the problem was then. Change-Id: I0dba895b041fe6cf81e6f8939ca85035cd00aad1 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Introducing the Qt Android portPaul Olav Tvete2013-03-051-4/+4
| | | | | | | | | | | | | | | | | | | | | Based on the Necessitas project by Bogdan Vatra. Contributors to the Qt5 project: BogDan Vatra <bogdan@kde.org> Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> hjk <hjk121@nokiamail.com> Oswald Buddenhagen <oswald.buddenhagen@digia.com> Paul Olav Tvete <paul.tvete@digia.com> Robin Burchell <robin+qt@viroteck.net> Samuel Rødal <samuel.rodal@digia.com> Yoann Lopes <yoann.lopes@digia.com> The full history of the Qt5 port can be found in refs/old-heads/android, SHA-1 249ca9ca2c7d876b91b31df9434dde47f9065d0d Change-Id: Iff1a7b2dbb707c986f2639e65e39ed8f22430120 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Mark all qtbase headers that aren't cleanThiago Macieira2013-03-032-0/+2
| | | | | | | | | | | | | | | | QtCore has a few headers that, though public, aren't meant to be included directly. Those are the atomic headers, the three _impl.h headers and qt_windows.h. QtGui includes two OpenGL headers that don't compile on their own. Other libraries should not have headers like that (but they do, something we need to fix eventually). Change-Id: I55e4eb057748f47df927ee618f9409acbc189cc1 Reviewed-by: Sean Harmer <sean.harmer@kdab.com> Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-02-141-38/+24
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/concurrent/doc/qtconcurrent.qdocconf src/corelib/doc/qtcore.qdocconf src/corelib/global/qglobal.h src/dbus/doc/qtdbus.qdocconf src/dbus/qdbusmessage.h src/gui/doc/qtgui.qdocconf src/gui/image/qimagereader.cpp src/network/doc/qtnetwork.qdocconf src/opengl/doc/qtopengl.qdocconf src/opengl/qgl.h src/plugins/platforms/windows/qwindowswindow.cpp src/printsupport/doc/qtprintsupport.qdocconf src/sql/doc/qtsql.qdocconf src/testlib/doc/qttestlib.qdocconf src/tools/qdoc/doc/config/qt-cpp-ignore.qdocconf src/widgets/doc/qtwidgets.qdocconf src/xml/doc/qtxml.qdocconf Change-Id: Ie9a1fa2cc44bec22a0b942e817a1095ca3414629
| * QThread documentation: do not discourage the reimplementation of QThreadOlivier Goffart2013-02-041-38/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new QThread documentation now really discourage to reimplement QThread. But in fact, there are many cases where it is perfectly fine. And the example given is even a case where using worker object is wrong. The examle even contains a leak since the thread will never stop and will even leak. This changes put back some sentences from before commit d4ad9dbbf96884c0899e8f8116a8a056facd52d5. The sample code has been re-writen. Notice how reimpementing run takes less lines of code, less runtime overhead, no leaks, and also is more complete than the previous example. Change-Id: I6cb80826e917dd5ce442ccad2572ec692ccb25ab Reviewed-by: Andre Somers <andre@familiesomers.nl> Reviewed-by: Geir Vattekar <geir.vattekar@digia.com> Reviewed-by: Debao Zhang <hello@debao.me> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Added support for multicore CPUs for INTEGRITY (V10+) target.Florian Behrens2013-01-301-0/+7
| | | | | | | | | | | | | | QThread::idealThreadCount returns now the number of cores. Change-Id: Idc23fc3c257165f6a63c6a7686a57a4fe76f6413 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-2918-63/+0
| | | | | | | | | | | | | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* | Set some attributes on pthread condattrsThiago Macieira2013-01-283-14/+52
| | | | | | | | | | | | | | | | | | Make them use the monotonic clock if that's available. On Mac, the monotonic clock is not available -- Qt fakes monotonic support by using the Mach timebase -- so we need to use gettimeofday. Change-Id: Iaea0b0c0de1b4802780e2476dc3643b703db392c Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-01-2348-48/+48
|\| | | | | | | refs/staging/dev
| * Update copyright year in Digia's license headersSergio Ahumada2013-01-1848-48/+48
| | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | Use sched_get_priority_* functions only for SCHED_RR and SCHED_FIFOPasi Petäjäjärvi2013-01-231-2/+14
|/ | | | | | | | | In VxWorks set default values for scheduling priority to use SCHED_FIFO_HIGH_PRI and SCHED_FIFO_LOW_PRI defines for other scheduling policies than SCHED_RR or SCHED_FIFO. Change-Id: If78b84cd9ef94d7712206e9442e96cdba727610f Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* Replace macro qdoc with Q_QDOCDebao Zhang2013-01-086-12/+12
| | | | | | | | Both qdoc and Q_QDOC are used in source code, which looks not good. Change-Id: I4f3a71670278b0758d92bfa5db086a07e1b1acfd Reviewed-by: hjk <qthjk@ovi.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Don't use MPProcessorsScheduled on Mac OS XThiago Macieira2012-12-281-5/+2
| | | | | | | | | | | It's deprecated and it's not available on iOS anyway. The recommended way of getting the number of processors online is via sysctl or sysconf (both of which are just slightly below). qthread_unix.cpp:397:13: error: 'MPProcessorsScheduled' is deprecated: first deprecated in Mac OS X 10.7 [-Werror,-Wdeprecated-declarations] Change-Id: I4bf60985fbde155b78b840f3de3ff0a142b78b19 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Fix QMutex::tryLock with negative valuesThiago Macieira2012-12-231-3/+2
| | | | | | | | | | | | The Linux futex implementation had a Q_ASSERT for positive values, but the documentation says that negative values should be interpreted as infinite (equal to lock()). Test that too. Change-Id: I2f96a502d672732781e88e49797756ca9a809121 Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix some typosSergio Ahumada2012-12-211-2/+2
| | | | | Change-Id: I4e8d9bd8ea66ec810e4f1fbfd8ddbf25c4b3d980 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* Review of documentation.Michele Caini2012-12-201-1/+1
| | | | | | | Terms fixing. Changes apply to Qt5 as well as Qt4. Change-Id: Ibb31ab0d68c62f3feb63722dd967932c2543fa37 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Similarly to the 797f3c0a01e9, fix qbasicatomic.h inclusionThiago Macieira2012-12-191-2/+2
| | | | | | | | qatomic.h includes qbasicatomic.h, so break the cyclic inclusion problem. Change-Id: If72bacbcfa36993336786f31e8980fbd43df8bdc Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Document the new load / store methods in QAtomic{Int,Pointer}Thiago Macieira2012-12-122-0/+86
| | | | | | | Task-number: QTBUG-24627 Change-Id: Iaa2573aa8f0f36cac81efa73020c2f365bfcba53 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Doc: Remove the mention of non-atomic convenience operators in QAtomicThiago Macieira2012-12-121-12/+0
| | | | | | | | | | For two reasons: 1) those operators are gone and 2) the ones that remain are atomic. Task-number: QTBUG-28532 Task-number: QTBUG-24627 Change-Id: I1e9d1b076d923546c1ee3d45f312066590f97416 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QtBase: Doc: Fix links to STL-style iteratorsDavid Schulz2012-12-061-4/+4
| | | | | Change-Id: I2822c2a7e9bfc1949c20ff81e08961f641e961fb Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Fixed compatibility problem with ExceptionhandlingHolger Ihrig2012-11-301-1/+1
| | | | | | | | | | | When QtBase is compiled with Exeptions it was incompatible with the other modules compiled with QT_NO_EXCEPTIONS. This resulted in a linker error with ExceptionStore::throwPossibleExceptions, one time returning a const value and the other time without it Change-Id: I0e0dff61aceeec3cfde119b00ed15f3aa9f12659 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Document how to name threads.Mitch Curtis2012-11-281-0/+8
| | | | | | Change-Id: If7a7bf4f54509ebb86ce394d8bb5a7748ef419d5 Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* QtCore: Make more signals private.Stephen Kelly2012-11-283-7/+15
| | | | | | Change-Id: Ida190e8b9c1ff47a6f54a5bf68673ab50a2f1bfe Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Fix race condition on d->state, by locking the mutex first.David Faure2012-11-231-3/+9
| | | | | | | | Detected by helgrind ./tst_qurl testThreads Change-Id: I0fe01153cd119741ce8a2bfe7dddead7c6ebf0b0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Fix QMutex::tryLock timeout computation on LinuxOlivier Goffart2012-11-161-2/+2
| | | | | | | | | | | The timeout is in millisecond. So we just need to divide by 1000 to get the number of seconds Regression introduced in f587e8f4fd670f11fa1e878c1015d7241033559a Reported in the comments of QTBUG-24795 Change-Id: Id16e05e7d04d33605860926f7516d14cdefd6a36 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFutureInterface: Remove unused functionOrgad Shaneh2012-11-082-6/+0
| | | | | | | | Following 731ba8ed08f80644b403556638c7f6229e678ebe this function is not used anymore Change-Id: Id908931b4b21c825bd80a4f03790630818c73c07 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Do not define QT_BASIC_ATOMIC_HAS_CONSTRUCTORS for clang.Erik Verbruggen2012-11-071-1/+12
| | | | | | | | | | This triggers a bug in clang (before version 3.2). See also the bug report: http://llvm.org/bugs/show_bug.cgi?id=12670 . Change-Id: I9e0bc1cc39059ffa5e062652b932bc01e453ef98 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Review of documentation.Michele Caini2012-11-021-6/+25
| | | | | | | Documentation has been updated, changes apply to Qt5 as well as Qt4. Change-Id: I13241a3b4c16d2cb1b24f80fe26832467621923a Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix for leak in QFutureChristian Strømme2012-11-013-5/+46
| | | | | | | | | | | To avoid leaking when converting a QFuture<T> to a QFuture<void> we need to have a separate ref. counter for QFuture<T>. When the last QFuture<T> goes out of scope, we need to clean out the result data. Task-number: QTBUG-27224 Change-Id: I965a64a11fffbb191ab979cdd030a9aafd4436c2 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Remove stale QT_MODULE() usage casesKonstantin Ritt2012-10-251-2/+0
| | | | | | | As of Qt5, this macro is defined to be empty; simply get rid of these leftovers. Change-Id: I167ccb4c9e92ec9b5e4faeb02bf9c5ef5d982b50 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Trim trailing whitespace.Stephen Kelly2012-10-221-1/+1
| | | | | Change-Id: Iee6bb66831f53399e5937eab5704af835979f5c3 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove the QThread::terminated() signalSze Howe Koh2012-10-195-37/+9
| | | | | | | | | | | | | | | | | The signal is removed from the API; all references to it are removed from documentation; the unit test that checks for its emission is modified to listen for QThread::finished() instead. The QThreadPrivate::terminated flag is also removed, as it served no purpose other than to trigger the emission of QThread::terminated() As discussed at http://lists.qt-project.org/pipermail/development/2012-October/007216.html the signal is not guaranteed to be emitted after every termination, rendering it useless. Change-Id: I7b0c45d7889da0d33875545331606f2208ee56fc Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix for memory leak in ResultStoreChristian Strømme2012-10-181-1/+4
| | | | | | | | | | | In ResultStoreBase::addResults() it possible that the ResultItem we create is invalid (filter-mode enabled). Since an invalid ResultItem won't have any result data, we need to make sure that we don't allocate any data for it. Task-number: QTBUG-27224 Change-Id: Ic99b191db0e9dd4e29b64911f87d90a8148bb7a5 Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* QThread signals documentation improvementOlivier Goffart2012-10-151-2/+12
| | | | | | | | | Be more explicit on from which thread the signals are emitted, and mention that it is possible to connect finished with deleteLater Change-Id: Ib72be94a81be383774f08d71915fa609843030e0 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* Review of documentation.Michele Caini2012-10-131-2/+10
| | | | | | | | Documentation has been updated, changes apply to Qt5 as well as Qt4. Change-Id: I562914a439d8d27dc9e6b1aa117007edce214cc6 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Doc: Update QThread class ref to reflect changes since Qt 4.4Sze Howe Koh2012-10-081-55/+104
| | | | | | | | | | | | | | Remove advice to subclass QThread; promote thinking of QThread as a thread manager, not a thread; promote event-driven programming over time micromanagement; warn against common pitfalls. Result of collaboration in forum (https://qt-project.org/forums/viewthread/20691/) and mailing list (https://qt-project.org/pipermail/development/2012-September/006738.html) Task-number: QTBUG-16358 Change-Id: I57e3873976fad489176cbf9f7e680fd6992a8837 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
* qfuturesynchronizer.cpp: fix whitespace errorsMarc Mutz2012-09-281-14/+14
| | | | | Change-Id: I106ae536f1411939c3785f0a97c39752db59b19c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QException/QFuture*: add \inmodule QtCoreMarc Mutz2012-09-284-0/+5
| | | | | Change-Id: Iad787e3280889eae6b6aace9a85bda966b1a7094 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QFutureSynchronizer back to QtCoreMarc Mutz2012-09-283-0/+277
| | | | | | | This class, too, belongs with QFuture. Change-Id: I41a532ca66c156f1631e4b22ffc1a5879c854488 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QFutureWatcher back to QtCoreMarc Mutz2012-09-285-1/+912
| | | | | | | | This belongs with QFuture. Change-Id: I555cd01c1d3890fbbaca4fd8a9170292ea4eb0fb Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QFuture from QtConcurrent to QtCoreMarc Mutz2012-09-286-0/+2020
| | | | | | | | | This class belongs to QThreadPool/QRunnable more than to QtConcurrent, so move to QtCore, where QThreadPool awaits it. Change-Id: Ibf20288a986593bf779453427c2dae8db1e1423a Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QtConcurrent::ResultStore as QtPrivate::ResultStore to QtCoreMarc Mutz2012-09-283-0/+496
| | | | | | | | | | No compatibility header needed. While this wasn't marked as private API, it wasn't documented, either. This is a prerequisite for moving QFuture to QtCore. Change-Id: I8e986e6e2a22fbe5cf08d0600ec39ae9ae993e20 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QtConcurrent::Exception as QException back to QtCoreMarc Mutz2012-09-283-0/+331
| | | | | | | | | Leave the old name as a deprecated typedef; adapt users. This is a prerequisite for moving QFuture back to QtCore. Change-Id: I81dcee2c7e6eb234c16f3f42e2415ca0da3dc4f8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QPostEventList: change pointer comparison to integer comparisonMarc Mutz2012-09-271-1/+1
| | | | | | | | | | This is exactly the type of pointer arithmetics that GCC likes to miscompile. Just use offset >= size() (=subtract begin() from both sides). Change-Id: Ifb13652d7b96bf4c06727d9c965516e95d16ab5c Reviewed-by: Olivier Goffart <ogoffart@woboq.com>