summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-28 09:09:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-29 09:05:39 +0200
commit37f9fdc11c4e95d6a34cb515a454503256a82c63 (patch)
tree35099c65caf4c62451a5b7a7c0bac249473c9733 /bridges
parent4c91b89d8ce9c34179f31854dc88bd0a9fa84cba (diff)
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'bridges')
-rw-r--r--bridges/source/cpp_uno/msvc_win32_intel/except.cxx12
-rw-r--r--bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx4
-rw-r--r--bridges/source/jni_uno/jni_base.h6
3 files changed, 11 insertions, 11 deletions
diff --git a/bridges/source/cpp_uno/msvc_win32_intel/except.cxx b/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
index 82fcf345cd0d..8e6a1795f898 100644
--- a/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_intel/except.cxx
@@ -132,7 +132,7 @@ type_info * RTTInfos::getRTTI( OUString const & rUNOname ) throw ()
{
// insert new type_info
OString aRawName( OUStringToOString( toRTTIname( rUNOname ), RTL_TEXTENCODING_ASCII_US ) );
- __type_info * pRTTI = new( ::rtl_allocateMemory( sizeof(__type_info) + aRawName.getLength() ) )
+ __type_info * pRTTI = new( std::malloc( sizeof(__type_info) + aRawName.getLength() ) )
__type_info( NULL, aRawName.getStr() );
// put into map
@@ -162,7 +162,7 @@ RTTInfos::~RTTInfos() throw ()
{
__type_info * pType = reinterpret_cast<__type_info*>(iPos->second);
pType->~__type_info(); // obsolete, but good style...
- ::rtl_freeMemory( pType );
+ std::free( pType );
}
}
@@ -184,7 +184,7 @@ struct ObjectFunction
inline void * ObjectFunction::operator new ( size_t nSize )
{
- void * pMem = rtl_allocateMemory( nSize );
+ void * pMem = std::malloc( nSize );
if (pMem != 0)
{
DWORD old_protect;
@@ -198,7 +198,7 @@ inline void * ObjectFunction::operator new ( size_t nSize )
inline void ObjectFunction::operator delete ( void * pMem )
{
- rtl_freeMemory( pMem );
+ std::free( pMem );
}
@@ -329,7 +329,7 @@ RaiseInfo::RaiseInfo( typelib_TypeDescription * pTypeDescr ) throw ()
}
// info count accompanied by type info ptrs: type, base type, base base type, ...
- _types = ::rtl_allocateMemory( sizeof(sal_Int32) + (sizeof(ExceptionType *) * nLen) );
+ _types = std::malloc( sizeof(sal_Int32) + (sizeof(ExceptionType *) * nLen) );
*(sal_Int32 *)_types = nLen;
ExceptionType ** ppTypes = (ExceptionType **)((sal_Int32 *)_types + 1);
@@ -349,7 +349,7 @@ RaiseInfo::~RaiseInfo() throw ()
{
delete ppTypes[nTypes];
}
- ::rtl_freeMemory( _types );
+ std::free( _types );
delete _pDtor;
}
diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
index f2e0cdc594a5..b1e14fbdf234 100644
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
+++ b/bridges/source/cpp_uno/msvc_win32_x86-64/except.cxx
@@ -371,7 +371,7 @@ type_info_descriptor * RTTInfos::insert_new_type_info_descriptor(OUString const
// insert new type_info
OString aRawName(OUStringToOString(toRTTIname(rUNOname), RTL_TEXTENCODING_ASCII_US));
- type_info_descriptor * pRTTI = new(::rtl_allocateMemory(sizeof(type_info_descriptor) + aRawName.getLength()))
+ type_info_descriptor * pRTTI = new(std::malloc(sizeof(type_info_descriptor) + aRawName.getLength()))
type_info_descriptor(nullptr, aRawName.getStr());
// put into map
@@ -621,7 +621,7 @@ RaiseInfo::RaiseInfo(typelib_TypeDescription * pTD)throw ()
// 32 bit offsets
const int totalSize = codeSize + typeInfoArraySize + excTypeAddLen;
unsigned char * pCode = _code =
- static_cast<unsigned char *>(::rtl_allocateMemory(totalSize));
+ static_cast<unsigned char *>(std::malloc(totalSize));
int pCodeOffset = 0;
// New base of types array, starts after Trampoline D-Tor / C-Tors
diff --git a/bridges/source/jni_uno/jni_base.h b/bridges/source/jni_uno/jni_base.h
index c7ab58a0078d..6fc2aeb7b447 100644
--- a/bridges/source/jni_uno/jni_base.h
+++ b/bridges/source/jni_uno/jni_base.h
@@ -205,9 +205,9 @@ inline JLocalAutoRef & JLocalAutoRef::operator = ( JLocalAutoRef & auto_ref )
struct rtl_mem
{
static void * operator new ( size_t nSize )
- { return rtl_allocateMemory( nSize ); }
+ { return std::malloc( nSize ); }
static void operator delete ( void * mem )
- { if (mem) rtl_freeMemory( mem ); }
+ { std::free( mem ); }
static void * operator new ( size_t, void * mem )
{ return mem; }
static void operator delete ( void *, void * )
@@ -218,7 +218,7 @@ struct rtl_mem
inline rtl_mem * rtl_mem::allocate( std::size_t bytes )
{
- void * p = rtl_allocateMemory( bytes );
+ void * p = std::malloc( bytes );
if (nullptr == p)
throw BridgeRuntimeError( "out of memory!" );
return static_cast<rtl_mem *>(p);