diff options
author | Robin Burchell <robin+qt@viroteck.net> | 2012-04-06 16:34:19 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-11 10:46:19 +0200 |
commit | 7be255156feb7636a5cca5c4fe78f42879ffe69b (patch) | |
tree | 0255287041af5b79cb437e7d9003cd4c9a179dfc /tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp | |
parent | 5dc506ad841685c8404c085bd8cf9c5442518897 (diff) |
Deprecate qMemCopy/qMemSet in favour of their stdlib equivilents.
Just like qMalloc/qRealloc/qFree, there is absolutely no reason to wrap these
functions just to avoid an include, except to pay for it with worse runtime
performance.
On OS X, on byte sizes from 50 up to 1000, calling memset directly is 28-15%
faster(!) than adding an additional call to qMemSet. The advantage on sizes
above that is unmeasurable.
For qMemCopy, the benefits are a little more modest: 16-7%.
Change-Id: I98aa92bb765aea0448e3f20af42a039b369af0b3
Reviewed-by: Giuseppe D'Angelo <dangelog@gmail.com>
Reviewed-by: John Brooks <john.brooks@dereferenced.net>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp')
-rw-r--r-- | tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp index 932d652b69..827fa3606c 100644 --- a/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp +++ b/tests/auto/gui/image/qimagewriter/tst_qimagewriter.cpp @@ -112,7 +112,7 @@ static void initializePadding(QImage *image) if (paddingBytes == 0) return; for (int y = 0; y < image->height(); ++y) { - qMemSet(image->scanLine(y) + effectiveBytesPerLine, 0, paddingBytes); + memset(image->scanLine(y) + effectiveBytesPerLine, 0, paddingBytes); } } @@ -454,7 +454,7 @@ void tst_QImageWriter::saveWithNoFormat() SKIP_IF_UNSUPPORTED(format); QImage niceImage(64, 64, QImage::Format_ARGB32); - qMemSet(niceImage.bits(), 0, niceImage.byteCount()); + memset(niceImage.bits(), 0, niceImage.byteCount()); QImageWriter writer(fileName /* , 0 - no format! */); if (error != 0) { |