summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlist.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix parsing of documentation for QByteArrayList and QStringListOlivier Goffart2016-03-231-1/+4
| | | | | | | | | | | QListSpecialMethod is an internal class. Everything needs to be hidden from Q_QDOC otherwise while parsing with clang, we get errors. Importantly, hides it while inheriting from QList so it does not appear in the documentation Change-Id: If2ac158f35d6a367aa033cfc7e6a054c912359b9 Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
* QList: don't lose reserved capacity in op+= with empty LHSMarc Mutz2016-02-061-1/+1
| | | | | | | | | | | | | | It is very rare that operator+= is used as operator=. Most of the time, one op+= is followed by more op+=s. The old code checked whether *this was empty, and simply shallow-copied the RHS into the LHS in that case. This has one severe drawback: a reserve() on the LHS is lost. Fix by not checking for isEmpty() but for d == &shared_null. Change-Id: Iff28e496cf24cc93f248449d74012c4f3a87253e Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* 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>
* Make container move semantics consistentMarc Mutz2015-10-071-3/+4
| | | | | | | | | | | | | | | Make all containers (excepting QVarLengthArray) - nothrow default-constructible - nothrow move-constructible - nothrow move-assignable - nothrow swappable [ChangeLog][QtCore] All containers (with the exception of QVarLengthArray, but including QSharedPointer) are now nothrow_default_constructible, nothrow_move_constructible, nothrow_move_assignable, and nothrow-swappable. Change-Id: I12138d262f9f7f600f0e1218137da208c12e7c0a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add a dedicated QListData::realloc_grow for growing QListThiago Macieira2015-08-101-0/+1
| | | | | | | | | This hides the call to ::grow to now two places in the source code, so it will be easier to fix the inefficient call to qAllocMore. Change-Id: I5d1e6f7607404caa96e4ffff13e80a3e4cb0ee93 Reviewed-by: Ulf Hermann <ulf.hermann@theqtcompany.com> Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
* Containers: destroy previous state on move-assignment immediatelyMarc Mutz2015-07-191-1/+1
| | | | | | | | | | | | | | | | [ChangeLog][QtCore] All generic containers (with the exception of QVarLengthArray, but including QSharedPointer) destroy the previous state as part of a move-assignment now. Previously, they would dump it into the right-hand-side object. Note that this is only true for the generic containers. Other implicitly-shared types, as well as the non-generic containers QString, QByteArray, etc. still just swap the contents with the right-hand-side object when move-assigned into, and, for performance reasons, this will not change in the forseeable future. Change-Id: I1f1c684e85400b77bd2e7fba65bde2dce6c1bdde Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList: mark const variants of begin()/end() noexceptMarc Mutz2015-07-191-45/+45
| | | | | | | | | Plus some other trivial functions. Drive-by change: 0 -> Q_NULLPTR (public header) Change-Id: Ic3fca2950e4c5143eb90bd119da113fe64e48032 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList: Introduce constFirst() and constEnd()Sérgio Martins2015-06-271-0/+2
| | | | | | | | | | Allows to easily prevent detaching in common code like: getList().first() [ChangeLog][QtCore][QList] Added the convenience constFirst and constLast functions. Task-number: QTBUG-46026 Change-Id: I51ecb51fe91fc7d993ad35b5c7392f4da88e5f7b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList: partially revert ab8366b5923ec0feb730df98040885669f7bbe38Marc Mutz2015-05-171-0/+10
| | | | | | | | | | | | | | | | That commit removed the user-defined copy constructors, under the assumption that this would be ok for these non-exported classes. But the change is still BiC, because it turns the iterators into trivial types, which changes the way they are passed into functions by value. So, delay the change until Qt 6. Change-Id: I8065ff1ff78f5722505328447f2496777d1e8957 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-04-221-1/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/gui/painting/qdrawhelper.cpp src/plugins/platforms/xcb/qxcbnativeinterface.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/plugins/platforms/xcb/qxcbwindow.h src/testlib/qtestblacklist.cpp src/tools/qdoc/node.cpp src/tools/qdoc/node.h tests/auto/gui/painting/qcolor/tst_qcolor.cpp Change-Id: I6c78b7b162001712d5774293f501b06b4ff32684
| * QList: make QListSpecialMethods dtors protectedMarc Mutz2015-04-161-1/+6
| | | | | | | | | | | | | | | | | | QList publicly inherits from QListSpecialMethods. Thus, any specialisation of QListSpecialMethods should make their destructor protected, to avoid deletion through a pointer to QListSpecialMethods invoking UB. Change-Id: I7e317606f84826cc0faf1bfc05dee97da6eaf2eb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add qHash(QList)Marc Mutz2015-04-201-0/+8
| | | | | | | | | | | | | | | | | | QLists can be compared for equality, so qHash should be overloaded, too. [ChangeLog][QtCore][QList] Added qHash(QList). Change-Id: I9ad91811f12479764cc17d87192539612ceb0b4c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QList: remove (const_)iterator copy ctorsMarc Mutz2015-04-171-2/+0
| | | | | | | | | | | | | | The compiler-generated ones are just fine. Change-Id: I528431040552326dad043b3b8d0db6af8146d3d2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QList: add {const_,reverse_iterator}, {c,}r{begin,end}()Marc Mutz2015-04-051-0/+8
| | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QList] Added rbegin(), crbegin(), rend(), crend(), and reverse_iterator and const_reverse_iterator typedefs. Task-number: QTBUG-25919 Change-Id: Icce870c22931e68cdcedd1519651bfa374ac44af Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QList: add relational operators <,<=,>,>=Marc Mutz2015-04-051-0/+30
|/ | | | | | | | | | std::vector has them, too. [ChangeLog][QtCore][QList] Added relational operators <, <=, >, >= if the element type supports operator<. Change-Id: Id2bd905e92c0365ad9f439d49908045c8df309c3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList: share implementation of operator== with QVector where possibleMarc Mutz2015-02-171-0/+17
| | | | | | | Same change as was already applied for count() and contains(). Change-Id: Ibd62e4b36e03741993ba33e730c9449ef19bff5f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList: share the implementations of contains()/count() with QVector where ↵Marc Mutz2015-02-171-0/+34
| | | | | | | | | | | | | | | | | | possible If QList data-layout-compatible with QVector and a C array, implement count() via std::count() and contains() via std::find() and use const_pointer instead of const_iterator as the iterators. This essentially makes the QVector and QList implementations identical to each other, at least for important cases such as QString. To switch between the different implementations, use tag dispatching instead of the previously used technique "use 'if' as if it were 'static if'", which imposes accidental requirements on the element types (something that esp. QVector is plagued with). Change-Id: I6caf74442a22059676b5bf115a6089768f3a0952 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList: prepare for tag dispatching based on memory layoutMarc Mutz2015-02-171-0/+19
| | | | | | | | | | | | | Add one tag class for each of QList's three different memory layouts to QListData, and inherit QList<T>::MemoryLayout from exactly one of them. To simplify overloading, added tag classes that express the negation of the two extreme poles of memory layout (C-compatible and heap), too. The "missing" one could be added when needed, too. Change-Id: I45ea603731499fd3fdfb37d60a0a98fb22ac15ec Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
* QtCore: mark some operations nothrowMarc Mutz2015-01-101-1/+1
| | | | | | | | | | | | This shotgun-surgery approach is motivated by trying to get a clean(er) build for -Wnoexcept on GCC, so it is expected that for any class touched here, there will be more operations that can be marked nothrow. But they don't show up in conditional noexcept clauses, yet, so they are deferred to some later commit. Change-Id: I0eb10d75a26c361fb22cf785399e83b434bdf233 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move a few QStringList methods up to QList<QString>Thiago Macieira2015-01-071-0/+1
| | | | | | | | This should be completely source-compatible, aside from the indirect header order change. Change-Id: I4cf8800ea1bfeb3023c7319991ab8ae281c925e8 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QList::swap: implement the swap with std::swapGiuseppe D'Angelo2014-11-261-3/+1
| | | | | | Change-Id: Ide2f8a5581978986607de99ac9b5e9c15b3aceff Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-11-241-10/+13
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qiodevice.cpp src/plugins/bearer/linux_common/qofonoservice_linux.cpp src/plugins/bearer/linux_common/qofonoservice_linux_p.h src/plugins/platforms/android/qandroidplatformtheme.cpp src/tools/bootstrap/bootstrap.pro src/widgets/styles/qmacstyle_mac.mm Change-Id: Ia02aab6c4598ce74e9c30bb4666d5e2ef000f99b
| * Fix warnings about size conversion in QListThiago Macieira2014-10-311-10/+13
| | | | | | | | | | | | | | | | | | | | | | Because difference_type is 64-bit on 64-bit systems, there's a downconversion warning from MSVC and possibly other compilers when it gets passed to functions taking simply int. Task-number: QTBUG-41092 Change-Id: I46a710810f4a57b8b84c4933f419a1f1fdf6bb5a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QList: iterate forward in count()/contains()Marc Mutz2014-10-011-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | After much head-scratching, we found no reason for the backwards iteration. Indeed, forward iteration should be slightly faster than backwards, because it operates in the direction in which cache-lines are filled, usually. This is in preparation of using std algorithms instead of hand-written loops. It avoids having to use std::reverse_iterator. Change-Id: Ib62cf0a6f2a33d186cb174b23b0d6bb2891b6c63 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QList: iterate forward in operator==Marc Mutz2014-10-011-5/+4
|/ | | | | | | | | | | | After much head-scratching, we found no reason for the backwards iteration. Indeed, forward iteration should be slightly faster than backwards, because it operates in the direction in which cache-lines are filled, usually. This is in preparation of using std algorithms instead of hand-written loops. It avoids having to use std::reverse_iterator. Change-Id: I31be6ad2b6d78ccce7e8a8f8f8b9e0af62f7471b Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
* QList: check d for equality before d->size for inequalityMarc Mutz2014-08-281-2/+2
| | | | | | | Same change as was already applied to QVector::operator==(). Change-Id: Ic2e140a52ee95f2e215668077951de0b4450d194 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Move the special QByteArrayList methods into QListThiago Macieira2014-08-091-2/+7
| | | | | | | | | | | | | | | | | | | | | | | and make QByteArrayList be a simple typedef. As a side-effect, the constructor taking a QByteArray is no longer available since I couldn't find a way to add it to QList<T> when T is QByteArray. My template-foo failed me. I tried: - QEnableIf<is_same<T, QByteArray>::value, QByteArray>::type => makes QList fail to compile for any T that isn't QByteArray - make the constructor a template member => it compiles if the parameter is a QByteArray, but not a const char[4] like the test was - inheriting constructors => runs into ICC and Clang bugs that I could not work around Besides, the constructor with std::initializer_list is a superior solution anyway. Change-Id: Ic86fbadc1104142bfd907a5c4147199bf839fb89 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* QList: Fix MSVC 64bit warning about loss of data.Friedemann Kleint2014-08-051-1/+1
| | | | | | | | qlist.h(133) : warning C4267: 'argument' : conversion from 'size_t' to 'int', possible loss of data qlist.h(131) : while compiling class template member function 'QList<QString>::QList(std::initializer_list<T>)' Change-Id: I8a11e298cd10da199490fbd8b269405a9e1cf5f3 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QList: add missing reserve() call in the initializer_list ctorMarc Mutz2014-08-031-1/+1
| | | | | Change-Id: Idc46a347009556d06db4bc1f7ce3e2613fb1a405 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Unify all mid() functions in QtBase.Jędrzej Nowacki2014-05-161-3/+11
| | | | | | | | | | | | | | | | | | | Up to now, Qt had at least 3 different implementations of the mid(). Only QString::mid implementation was not crashing on edge cases and was protected against overflows, therefore I picked that one as the base implementation, even if it has weird semantics for an invalid input. As a side effect QVector::mid was slightly optimized to not detach in all cases (which follows current QList behavior). Documentation of QVector::mid and QList::mid was updated to not mention "copy of data" which could suggest that the mid() result is detached. QStringRef::mid was fixed and now it follows general Qt behavior, by returning a null value for a null input. Change-Id: Ie9ff5d98372bd193d66508e6dd92b6ed1180ad9b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Deprecate setSharable in Qt containersThiago Macieira2014-04-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The ability to set a container to be unsharable has very little use and it costs us an extra conditional for every refcount up and possibly down. This change is a no-op for current Qt 5. It shuffles a few things around just so Qt can compile if you define QT_NO_UNSHARABLE_CONTAINERS. That is done to ease the fixing of the code in Qt 6 and to make my life easier: I'll keep that defined in my local Qt build so I can catch any misuses of this deprecated API. The newly deprecated methods are not marked QT_DEPRECATED because the bootstrapped tools wouldn't build -- they're built with QT_NO_DEPRECATED defined, which causes build errors. [ChangeLog][QtCore] The setSharable() and isSharable() functions in Qt containers has been deprecated and will be removed in Qt 6. New applications should not use this feature, while old applications that may be using this (undocumented) feature should port away from it. Discussed-on: http://lists.qt-project.org/pipermail/development/2014-February/015724.html Change-Id: I789771743dcaed6a43eccd99382f8b3ffa61e479 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Remove level 4 compiler warnings from MSVC.David Schulz2014-03-151-0/+9
| | | | | | | | | | Task-number: QTBUG-7233 Change-Id: I52067e3a22e98a62fd87415906e54a54ff2d6b49 Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com> Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Dave McClelland
* Fix ‘looses precision’ warning in public APIKurt Pattyn2013-12-271-1/+1
| | | | | Change-Id: I935e6f278e539f8e6aaca0bc381371ec85aa5c67 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Change an addition into a subtractionThiago Macieira2013-10-191-1/+1
| | | | | | | | | | | | | | | | This potentially resolves the long-standing warning from GCC: assuming signed overflow does not occur when assuming that (X + c) < X is always false GCC prints the warning to warn people that you can't check for overflow with signed integers by doing that (signed integers don't overflow in the standard). If we change this to X < X - c, there's no overflow. Task-number: QTBUG-33314 Change-Id: I5b166610a39559ec7b03c4c31ee5999efefa0c06 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove qCopy usages from QListGiuseppe D'Angelo2013-09-091-3/+4
| | | | | | | | QtAlgorithms is getting deprecated, see http://www.mail-archive.com/development@qt-project.org/msg01603.html Change-Id: Ib667321884b2f06de6f440f2b8e329361f926ce1 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QList - fix insert with iterator on shared instanceThorbjørn Martsum2013-08-241-1/+5
| | | | | | | | This patch ensures correct detach when insert with an iterator is called on a shared instance (i.e same behavior as QVector) Change-Id: Id660eacd3cc7b633456dfa989997bbad747e1df2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList - fix QList::erase when the list is sharedThorbjørn Martsum2013-08-241-0/+15
| | | | | | | | | | | | Before calls to erase on a shared instance would in release mode imply that items were removed from the shared data (i.e all instances). In debug mode it would assert. This patch improves the behavior to detach and erase items specified by the iterator(s) (i.e same behavior as QVector) Change-Id: I89b69446cb1ffd43a98402b7ab1ec9a59bceb8e6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-08-141-12/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure mkspecs/macx-xcode/Info.plist.app mkspecs/macx-xcode/Info.plist.lib qmake/doc/qmake.qdocconf src/corelib/global/qglobal.h tests/auto/other/exceptionsafety/exceptionsafety.pro tests/auto/widgets/widgets/qcombobox/tst_qcombobox.cpp Change-Id: I3c769a4a82dc2e99a12c69123fbf17613fd2ac2a
| * Work around msvc /clr LNK2005 errors with QListRichard Browne2013-07-301-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes a compatibility with Qt 5 and Microsoft C++ /clr mode. The QList copy constructor defines a Cleanup class that causes LNK2005 errors. It is a compiler problem, but the patch is simple. The use of QT_TRY/QT_RETHROW instead of a Cleanup class is more consistent with other Qt code, so is arguably preferable even without the compiler bug. Task-number: QTBUG-31949 Change-Id: I1acfbae1924f0a52ffb8d9722b52e01b61edd42e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QList - check if iterators arguments are valid (in debugmode)Thorbjørn Martsum2013-07-121-2/+15
|/ | | | | | | This adds a check of the iterator values in erase and insert. Change-Id: I78403dcbd24fd7c6beb86d3c827a8e233963e770 Reviewed-by: Thiago Macieira <thiago.macieira@intel.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>
* Fix Clang warning about memcpy a class with vtablesThiago Macieira2012-12-231-1/+1
| | | | | Change-Id: I7966014a49cdf4c6c82f012d8b1d16ba8ddc3fcc Reviewed-by: Olivier Goffart <ogoffart@woboq.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 use of ::free from qlist.hThiago Macieira2012-08-091-5/+7
| | | | | | | | | | | | | | | | | The memory is allocated in qlist.cpp, so it should be freed in qlist.cpp. Freeing it in qlist.cpp ties our hands about future improvements to the allocator. In addition, silence the warning by the too-smart-for-its-own-good GCC that we're trying to free a non-heap object: qlist.h:763:14: warning: attempt to free a non-heap object "QListData::shared_null" [-Wfree-nonheap-object] The warning is wrong. It should say "possibly" somewhere because GCC failed to account for all conditions in the path to free(). Change-Id: I34a6c16bba9a2197fc83eb3c7a63ae06fb25bf15 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Implement the move constructor for containers.Olivier Goffart2012-05-111-1/+2
| | | | | | | | | | | | | | | This changes all the containers that uses QtPrivate::RefCount (QMap already had one), and QVariant In Qt 4.8, it was pointless to have the move constructor because we did not have quick way to re-initialize a null container. (shared_null still needed to be refcounted) But now that we have RefCount, and that the shared_null do not have reference count, we can implement a fast move constructor that do not generate code to increment the reference count. Change-Id: I2bc3c6ae96983f08aa7b1c7cb98d44a89255160b Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* Remove references to QT_NO_STL from QtCoreThiago Macieira2012-04-071-5/+0
| | | | | | | | QT_NO_STL is now no longer defined, so remove the conditionals and select the STL side. Change-Id: Ieedd248ae16e5a128b4ac287f850b3ebc8fb6181 Reviewed-by: João Abecasis <joao.abecasis@nokia.com>
* Remove all calls to, and deprecate qMalloc, qRealloc and qFree.Robin Burchell2012-03-311-5/+6
| | | | | | | | | | | | | | | | | | Callers should just call the standard allocation functions directly. Adding an extra function call onto all basic memory management for the sake of making it instrumentable in rare cases isn't really fair to everyone else. What's more, this wasn't completely reliable, as not everything was using them in a number of places. Memory management can still be overridden using tricks like LD_PRELOAD if needed. Their aligned equivilents cannot be deprecated, as no standard equivilents exist, although investigation into posix_memalign(3) is a possibility for the future. Change-Id: Ic5f74b14be33f8bc188fe7236c55e15c36a23fc7 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>