summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorBradley T. Hughes <bradley.hughes@nokia.com>2011-07-19 15:53:32 +0200
committerQt by Nokia <qt-info@nokia.com>2011-07-26 13:40:07 +0200
commit6b82798ee73dc8aac6f6a6c4c12ff291d6d7e9e1 (patch)
treeb815e752da268b5c4e895bbd25d6d920a9d59876 /bin
parentb7064513e2b0fc51f5f68d2057047ed30bae6eba (diff)
Add QFreeList as an internal class
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>
Diffstat (limited to 'bin')
0 files changed, 0 insertions, 0 deletions