[Libreoffice-commits] core.git: vcl/skia

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Sat Jun 27 08:16:04 UTC 2020


 vcl/skia/salbmp.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 92de6c794e6033ced0c6273f70b7d425a4c4e495
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Fri Jun 26 22:41:20 2020 +0200
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Sat Jun 27 10:15:32 2020 +0200

    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 at collabora.com>

diff --git a/vcl/skia/salbmp.cxx b/vcl/skia/salbmp.cxx
index 0474b4859405..5006f2cc824e 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();
@@ -763,7 +763,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;
     }


More information about the Libreoffice-commits mailing list