summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qfreelist_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* QFreeList: fix undefined behaviorMarc Mutz2015-01-191-1/+1
| | | | | | | | | | | | | | | | Signed integer overflow is undefined behavior ([expr]/4), but unsigned arithmetic doesn't overflow, so isn't ([basic.fundamental]/4, footnote there). So, use unsigned arithmetic for the loop-around serial number generation in incrementserial(). While we're at it, also use it for the masking operation in the same function. Found by UBSan. Change-Id: I500fae9d80fd3f6e39d06e79a53d271b82ea8df8 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Make QFreeList constexprThiago Macieira2014-06-301-2/+2
| | | | | | | It's still not a literal type because the destructor is not constexpr Change-Id: If89bdfdd3f0ffe9bdd5a7953e872e520e92cfd66 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* qfreelist: fix data race on v[at].nextDavid Faure2014-06-051-5/+5
| | | | | | | | Detected by clang's -fsanitize=thread in tst_qcoreapplication. Task-number: QTBUG-39024 Change-Id: I60b7cece0384f89dc62ac5128faf39a4084e72e2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix typos in comments (qfreelist and qmutex)David Faure2014-05-261-1/+1
| | | | | Change-Id: I782b18b9f82a72a29371564838252e1838faf86c Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+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>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Remove trailing comma in enumThiago Macieira2012-08-151-1/+1
| | | | | | | | | | | Spotted by ICC: qfreelist_p.h(127): warning #271: trailing comma is nonstandard BlockCount = 4, ^ Change-Id: Ib64d1d19ca0514e7582a295da48cbf6705aa8c44 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Simon Hausmann <simon.hausmann@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Remove use of QT_MODULE from libraryGunnar Sletta2012-01-251-1/+0
| | | | | | | | | | These defines were there to aid in the commercial licensing scheme we used long ago, and are no longer needed. Keep a QT_MODULE(x) define so other modules continue compiling. Change-Id: I8fd76cd5270df8f14aee746b6cf32ebf7c23fec7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Don't use implicit QAtomic* casts in QFreeListBradley T. Hughes2011-10-051-9/+9
| | | | | | | | | | | | | | | Pair the _next.testAndSetRelease() call in QFreeList<T>::release() with _next.loadAcquire(), to ensure that the update to the bucket being released is properly fenced. QFreeList<T>:next() does not need a release fence, only an acquire fence, which is placed on the memory bucket address load. Change-Id: Ib5b9d6ef6107f87aa8e3ea2dd3a7f9116c75da70 Reviewed-by: Thiago Macieira Reviewed-on: http://codereview.qt-project.org/5802 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Add QFreeList as an internal classBradley T. Hughes2011-07-261-0/+294
This is a generic implementation of the lock-free free list found in qabstracteventdispatcher.cpp. Use next() to get the next free entry in the list, and release(id) when done with the id. This version is templated and allows having a payload which can be accessed using the id returned by next(). The payload is allocated and deallocated automatically by the free list, but *NOT* when calling next()/release(). Initialization should be done by code needing it after next() returns. Likewise, cleanup should happen before calling release(). It is possible to have use 'void' as the payload type, in which case the free list only contains indexes to the next free entry. Autotest included. Change-Id: Ifd12a961d47f3d76593c45061f72e55c9b80a43b Reviewed-on: http://codereview.qt.nokia.com/2160 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>