diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-06-26 22:41:20 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-07-02 12:41:57 +0200 |
commit | 98236f7265fb53ad7c59b7a4c2a580f1181de22f (patch) | |
tree | 4272545ba4a851c866d8f459cdb6d9f6418bf254 | |
parent | e0b2dadd5d7a97acd047d074c346216a0cc8a4f0 (diff) |
use boost::make_shared_noinit()
The unnecessary initialization of all elements with plain
boost::make_shared() actually shows up in the profiler.
Change-Id: I054b13ac74362aca7f2dfa7dc746d3a80c7f1042
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97267
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
(cherry picked from commit fd0bcf17122c2b995437c84db49504304c946a10)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97290
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/skia/salbmp.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/vcl/skia/salbmp.cxx b/vcl/skia/salbmp.cxx index 1bf0f77bfc2a..30afc7c51d58 100644 --- a/vcl/skia/salbmp.cxx +++ b/vcl/skia/salbmp.cxx @@ -114,7 +114,7 @@ bool SkiaSalBitmap::CreateBitmapData() #ifdef DBG_UTIL allocate += sizeof(CANARY); #endif - mBuffer = boost::make_shared<sal_uInt8[]>(allocate); + mBuffer = boost::make_shared_noinit<sal_uInt8[]>(allocate); #ifdef DBG_UTIL // fill with random garbage sal_uInt8* buffer = mBuffer.get(); @@ -766,7 +766,7 @@ void SkiaSalBitmap::EnsureBitmapUniqueData() assert(memcmp(mBuffer.get() + allocate, CANARY, sizeof(CANARY)) == 0); allocate += sizeof(CANARY); #endif - boost::shared_ptr<sal_uInt8[]> newBuffer = boost::make_shared<sal_uInt8[]>(allocate); + boost::shared_ptr<sal_uInt8[]> newBuffer = boost::make_shared_noinit<sal_uInt8[]>(allocate); memcpy(newBuffer.get(), mBuffer.get(), allocate); mBuffer = newBuffer; } |