qt6-bb10/tests/auto/corelib/text
Marc Mutz 2fd990b386 Port qCompress() to zstream/deflate()
The zlib convenience API we've been using so far has two problems:

- On Windows-64, where sizeof(long) == 4, the use of ulong for sizes
  meant that we could not compress data compressable on other 64-bit
  platforms (Unix). While zstream also uses ulong, being a stream API,
  it allows feeding data in chunks. The total_in and total_out members
  are only required for gzip compression and are otherwise just
  informational. They're unsigned, so their overflow does not cause
  UB. In summary, using zstream + deflate() allows us to compress more
  than 4GiB of data even on Windows-64.

- On all platforms, we always allocated the output buffer in such a
  way as to accommodate the pathological case of random, incompressible
  data, so the output buffer was larger than the input. Using zstream
  + deflate(), we can start with a smaller buffer, then let zlib pick
  up where it left off when it ran out of output buffer space, saving
  memory in the common case that compression meaningfully reduces the
  size. To avoid the first few rounds of reallocations, we continue to
  use zlib's compressBound() for input less than 256KiB.

This completely fixes the compression side of QTBUG-106542 and
QTBUG-104972.

Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-104972
Fixes: QTBUG-106542
Change-Id: Ia7e6c38403906b35462480fd611b482f05a5c59c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-10-17 23:33:41 +02:00
..
qanystringview QAnyStringView: construct from any T implicitly convertible to QString/QByteArray 2022-09-01 15:51:48 +02:00
qbytearray Port qCompress() to zstream/deflate() 2022-10-17 23:33:41 +02:00
qbytearrayapisymmetry tst_QBAApiSymmetry::toInt_data(): deduplicate a data-row name 2022-10-11 11:24:01 +02:00
qbytearraylist Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qbytearraymatcher Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
qbytearrayview Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qbytedatabuffer Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qchar Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
qcollator Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qlatin1stringview QtBase tests: remove QT_DISABLE_DEPRECATED_UP_TO defines 2022-08-24 22:08:49 +02:00
qlocale tst_QLocale: use fenv everywhere 2022-09-15 23:41:51 +02:00
qregularexpression tst_QRE::wildcard(): use more informative data row tags 2022-10-11 11:24:11 +02:00
qstring Port from qAsConst() to std::as_const() 2022-10-11 23:17:18 +02:00
qstring_no_cast_from_bytearray Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qstringapisymmetry tst_QStringApiSymmetry: use startpos to deduplicate indexing data tags 2022-10-17 15:53:32 +02:00
qstringbuilder Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qstringconverter Port from container.count()/length() to size() 2022-10-04 07:40:08 +02:00
qstringiterator Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qstringlist Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qstringmatcher Reduce foldCasing of the needle in Boyer-Moore QString searches 2022-09-22 18:05:44 +02:00
qstringtokenizer Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
qstringview Port from qAsConst() to std::as_const() 2022-10-11 23:17:18 +02:00
qtextboundaryfinder Update UCD to Revision 30 2022-10-11 14:10:59 +00:00
qunicodetools Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
shared Provide optTitle for a NumberDoubleTestData testcase that needs it 2022-10-11 11:21:38 +02:00
CMakeLists.txt Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00