From 37f9fdc11c4e95d6a34cb515a454503256a82c63 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 28 Aug 2018 09:09:33 +0200 Subject: replace rtl_allocateMemory with std::malloc where used directly, since rtl_allocateMemory now just calls into std::malloc Change-Id: I59f85bdb7efdf6baa30e8fcd2370c0f8e9c999ad Reviewed-on: https://gerrit.libreoffice.org/59685 Tested-by: Jenkins Reviewed-by: Noel Grandin --- store/source/lockbyte.cxx | 4 ++-- store/source/storbase.hxx | 4 ++-- store/source/storbios.cxx | 6 +++--- store/source/storcach.cxx | 6 +++--- 4 files changed, 10 insertions(+), 10 deletions(-) (limited to 'store/source') diff --git a/store/source/lockbyte.cxx b/store/source/lockbyte.cxx index 09240505a7fb..444772e8ff8d 100644 --- a/store/source/lockbyte.cxx +++ b/store/source/lockbyte.cxx @@ -690,7 +690,7 @@ MemoryLockBytes::MemoryLockBytes() MemoryLockBytes::~MemoryLockBytes() { - rtl_freeMemory (m_pData); + std::free (m_pData); } storeError MemoryLockBytes::initialize_Impl (rtl::Reference< PageData::Allocator > & rxAllocator, sal_uInt16 nPageSize) @@ -776,7 +776,7 @@ storeError MemoryLockBytes::setSize_Impl (sal_uInt32 nSize) { if (nSize != m_nSize) { - sal_uInt8 * pData = static_cast(rtl_reallocateMemory (m_pData, nSize)); + sal_uInt8 * pData = static_cast(std::realloc (m_pData, nSize)); if (pData != nullptr) { if (nSize > m_nSize) diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx index 042a467db1b5..accfdf7d73f9 100644 --- a/store/source/storbase.hxx +++ b/store/source/storbase.hxx @@ -529,11 +529,11 @@ public: */ static void * operator new (size_t n) { - return rtl_allocateMemory (sal_uInt32(n)); + return std::malloc(sal_uInt32(n)); } static void operator delete (void * p) { - rtl_freeMemory (p); + std::free (p); } /** State. diff --git a/store/source/storbios.cxx b/store/source/storbios.cxx index fa76b5cc345d..2ba25fd53e8c 100644 --- a/store/source/storbios.cxx +++ b/store/source/storbios.cxx @@ -170,11 +170,11 @@ struct SuperBlockPage */ static void * operator new (size_t n) { - return rtl_allocateMemory (sal::static_int_cast(n)); + return std::malloc(sal::static_int_cast(n)); } static void operator delete (void * p) { - rtl_freeMemory (p); + std::free (p); } static void * operator new (SAL_UNUSED_PARAMETER size_t, sal_uInt16 nPageSize) @@ -183,7 +183,7 @@ struct SuperBlockPage } static void operator delete (void * p, SAL_UNUSED_PARAMETER sal_uInt16) { - rtl_freeMemory (p); + std::free (p); } /** Construction. diff --git a/store/source/storcach.cxx b/store/source/storcach.cxx index 2f74a872e9d0..a1037095c933 100644 --- a/store/source/storcach.cxx +++ b/store/source/storcach.cxx @@ -208,7 +208,7 @@ PageCache::~PageCache() if (m_hash_table != m_hash_table_0) { - rtl_freeMemory (m_hash_table); + std::free (m_hash_table); m_hash_table = m_hash_table_0; m_hash_size = theTableSize; m_hash_shift = highbit(m_hash_size) - 1; @@ -219,7 +219,7 @@ PageCache::~PageCache() void PageCache::rescale_Impl (std::size_t new_size) { std::size_t new_bytes = new_size * sizeof(Entry*); - Entry ** new_table = static_cast(rtl_allocateMemory(new_bytes)); + Entry ** new_table = static_cast(std::malloc(new_bytes)); if (new_table != nullptr) { @@ -255,7 +255,7 @@ void PageCache::rescale_Impl (std::size_t new_size) if (old_table != m_hash_table_0) { - rtl_freeMemory (old_table); + std::free (old_table); } } } -- cgit