summaryrefslogtreecommitdiffstats
path: root/tests/auto/core/handle/tst_handle.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rework resource handlingLars Knoll2017-11-071-75/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rework the way the QResourceManager allocates and manages it's resources. Get rid of the huge pre-allocated freelist, and instead merge it with the counter field (that is now always a quintptr large). Give QHandle a direct pointer to it's data in addition to the counter. This makes QHandle 8 or 16 bytes large, but speeds up access to it's data and gives more safety on the counter as that one now always has at least 31 bits. Counter and the linked freelist use the same memory location. To avoid potential conflicts, make sure the counter is always an odd number, so it can't be a valid pointer. Do not use INDEXBITS anymore, the resource manager can now always allocate as many resources as we have RAM available and will grow with the required use (and not allocate fixed memory upfront). This change reduces the memory consumption of the qardboard example from a bit above 40 to 10MB. Change-Id: I514f2d3f957f8635098fb88342e42e3361456340 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-011-12/+14
|\ | | | | | | Change-Id: I34a98a52cb30084471fd329e36cda7f64bf0af08
| * Replace “#define private public” with a proper friend class declarationDmitry Shachnev2016-06-201-4/+0
| | | | | | | | | | | | Change-Id: I98a31d165367e725c902df368c9c2824439a47d6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
| * Make QHandle tests pass on big endian systemsDmitry Shachnev2016-06-201-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QHandle uses an union internally so the value of handle is composed of values of three other integer fields, as defined in Data structure. The value is different on big endian and little endian systems. This commit introduces a new GET_EXPECTED_HANDLE macro which determines what the handle should be equal to based on values of those integer fields and the system endianness. Note that the values of those fields are verified too in the tests. Change-Id: I1f1e37a7469995879ff94e8fc2d6b974c1d4359b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* | Unify license header usageAntti Kokko2016-01-261-17/+9
|/ | | | | | | | Updated license headers to use new GPL-EXCEPT header instead of LGPL3 one (in those files which will be under GPL 3 with exceptions) Change-Id: I930c6234bfe720d38c596bbc3d1f39be75a7328b Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* d-pointer classes, private/public changesTomi Korpipää2015-10-301-1/+1
| | | | | | Change-Id: I4ca133aebad0c088296ab293f95f0a6d76d18395 Task-number: QTBUG-39946 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Move Qt3DCore into Qt3DCore namespaceSean Harmer2015-10-131-2/+2
| | | | | | | Update other aspects, tests and examples accordingly. Change-Id: Ib1bcf0bdf4f5aec4422dc0c80bfc32b27fb1a317 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
* Copyright header change.Mika Salmela2015-02-091-19/+14
| | | | | | | | As for preparation for Qt5.5 release the copyright header is updated to correspond the current license requirements. Change-Id: I36632918b66f455539453b42c369689fb11298ec Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Fix INDEXBITS in QHandleManager, QHandlePaul Lemire2014-04-091-0/+4
| | | | | | | | | | | | QHandleManager worked only when INDEXBITS was set to the default value 16. This is corrected now so that a QResourceManager<T, 4> created a QHandleManager<T, 4> which provides QHandle<T, 4> Follow up commits will follow for the refactoring of QResourcesManager into subclasses that can implement their own dedicated memory allocation scheme. Change-Id: If3b3fb43ae1c9473d9777cf9ba984ba37a65cfa9 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add QHandle template class and testSean Harmer2014-04-041-0/+179
With: Paul Lemire Change-Id: I47a228553da06d9692a206fd2424beea0a163b2f Reviewed-by: Paul Lemire <paul.lemire@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>