summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qringbuffer_p.h
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* QRingBuffer: retrieve pointer to data more carefullyAlex Trotsenko2015-01-091-1/+1
| | | | | | | | | | | An empty ring buffer always has a pre-cached byte array in its container. In this case size() indicates that no data is available, but readPointer() tries to resolve this byte array. To avoid an illegal pointer as a result, return Q_NULLPTR instead. Change-Id: Icc5f08f071a8f02a14c112b6e1adbe5373bd9466 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Simplify QRingBuffer::isEmpty()Alex Trotsenko2014-12-061-1/+1
| | | | | | | Also, make it consistent with size(). Change-Id: Ie5285e3c07ebba2d2eea05a80a75ce148da47d7b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* QRingBuffer: cache the last released blockAlex Trotsenko2014-12-021-8/+26
| | | | | | | | | | A typical ring buffer usage is a sequence of reserve()->chop()->read() cycles. Usually, between these cycles, the buffer doesn't contain data and all blocks are released. To reduce reallocations, keep the most recently used block while the buffer is empty. Change-Id: I8128f1f04649ae005fd0a480f17f95de01a9a135 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* QRingBuffer: optimize memory usageAlex Trotsenko2014-11-261-1/+1
| | | | | | | | | QByteArray resizing behavior is to preallocate a certain amount of memory for future growth. Make QRingBuffer aware of the extra capacity in QByteArray. Change-Id: I68310d5783fbc32e4fd5075ed3269ce6b7128a92 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make QRingBuffer::ungetChar() not leave empty array in buffer listAlex Trotsenko2014-10-131-2/+6
| | | | | Change-Id: Ic692693132f0c316ad068cad5423ca8fd32bd40d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.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>
* Rewrite QRingBufferAlex Trotsenko2014-07-241-191/+88
| | | | | | | | | QRingBuffer is a fully inlined class used in many I/O classes. So, it must be as fast and small as possible. To this end, a lot of unnecessary special cases were replaced by generic structures. Change-Id: Ic189ced3b200924da158ce511d69d324337d01b6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Make QRingBuffer::append() not leave empty arrays in buffer listAlex Trotsenko2014-07-231-3/+7
| | | | | Change-Id: I4c5af33488a70996299289ec2b953b7bf3b2c428 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* QRingBuffer: purge unused part of the apiAlex Trotsenko2014-07-181-33/+0
| | | | | | | Remove unused and untested class functions. Change-Id: I8eb963db0ae4be9b5cdde91f6747c4a1db4ea649 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Fix QRingBuffer::readPointerAtPosition()Alex Trotsenko2014-06-241-1/+1
| | | | | | | Fix condition to allow return a valid pointer when head != 0. Change-Id: I5215f7dfc44924016c2d9b67ab2d9935b5164d7a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* QRingBuffer: make constructor explicitMarc Mutz2012-02-291-1/+1
| | | | | | | | | | | | | | This is a private class, but it's so close to the classical Stack(int) example for explicit that I just have to make this ctor explicit, too: QRingBuffer rb = 0; // oops: meant '*rb' now no longer compiles. Change-Id: I7d58c1f08c1b14d14930426159c5c8db71b4cf4d Reviewed-by: Olivier Goffart <ogoffart@woboq.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>
* 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>
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+451
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12