summaryrefslogtreecommitdiff
path: root/cppu
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 /cppu
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 'cppu')
-rw-r--r--cppu/source/uno/copy.hxx22
-rw-r--r--cppu/source/uno/destr.hxx12
-rw-r--r--cppu/source/uno/sequence.cxx10
3 files changed, 22 insertions, 22 deletions
diff --git a/cppu/source/uno/copy.hxx b/cppu/source/uno/copy.hxx
index b6ecb3036577..31f70092c279 100644
--- a/cppu/source/uno/copy.hxx
+++ b/cppu/source/uno/copy.hxx
@@ -38,7 +38,7 @@ inline uno_Sequence * allocSeq(
sal_uInt32 nSize = calcSeqMemSize( nElementSize, nElements );
if (nSize > 0)
{
- pSeq = static_cast<uno_Sequence *>(rtl_allocateMemory( nSize ));
+ pSeq = static_cast<uno_Sequence *>(std::malloc( nSize ));
if (pSeq != nullptr)
{
// header init
@@ -137,21 +137,21 @@ inline void _copyConstructAnyFromData(
if (sizeof(void *) >= sizeof(sal_Int64))
pDestAny->pData = &pDestAny->pReserved;
else
- pDestAny->pData = ::rtl_allocateMemory( sizeof(sal_Int64) );
+ pDestAny->pData = std::malloc( sizeof(sal_Int64) );
*static_cast<sal_Int64 *>(pDestAny->pData) = *static_cast<sal_Int64 *>(pSource);
break;
case typelib_TypeClass_FLOAT:
if (sizeof(void *) >= sizeof(float))
pDestAny->pData = &pDestAny->pReserved;
else
- pDestAny->pData = ::rtl_allocateMemory( sizeof(float) );
+ pDestAny->pData = std::malloc( sizeof(float) );
*static_cast<float *>(pDestAny->pData) = *static_cast<float *>(pSource);
break;
case typelib_TypeClass_DOUBLE:
if (sizeof(void *) >= sizeof(double))
pDestAny->pData = &pDestAny->pReserved;
else
- pDestAny->pData = ::rtl_allocateMemory( sizeof(double) );
+ pDestAny->pData = std::malloc( sizeof(double) );
*static_cast<double *>(pDestAny->pData) = *static_cast<double *>(pSource);
break;
case typelib_TypeClass_STRING:
@@ -176,7 +176,7 @@ inline void _copyConstructAnyFromData(
case typelib_TypeClass_EXCEPTION:
if (pTypeDescr)
{
- pDestAny->pData = ::rtl_allocateMemory( pTypeDescr->nSize );
+ pDestAny->pData = std::malloc( pTypeDescr->nSize );
_copyConstructStruct(
pDestAny->pData, pSource,
reinterpret_cast<typelib_CompoundTypeDescription *>(pTypeDescr),
@@ -185,7 +185,7 @@ inline void _copyConstructAnyFromData(
else
{
TYPELIB_DANGER_GET( &pTypeDescr, pType );
- pDestAny->pData = ::rtl_allocateMemory( pTypeDescr->nSize );
+ pDestAny->pData = std::malloc( pTypeDescr->nSize );
_copyConstructStruct(
pDestAny->pData, pSource,
reinterpret_cast<typelib_CompoundTypeDescription *>(pTypeDescr),
@@ -296,21 +296,21 @@ inline void _copyConstructAny(
if (sizeof(void *) >= sizeof(sal_Int64))
pDestAny->pData = &pDestAny->pReserved;
else
- pDestAny->pData = ::rtl_allocateMemory( sizeof(sal_Int64) );
+ pDestAny->pData = std::malloc( sizeof(sal_Int64) );
*static_cast<sal_Int64 *>(pDestAny->pData) = 0;
break;
case typelib_TypeClass_FLOAT:
if (sizeof(void *) >= sizeof(float))
pDestAny->pData = &pDestAny->pReserved;
else
- pDestAny->pData = ::rtl_allocateMemory( sizeof(float) );
+ pDestAny->pData = std::malloc( sizeof(float) );
*static_cast<float *>(pDestAny->pData) = 0.0;
break;
case typelib_TypeClass_DOUBLE:
if (sizeof(void *) >= sizeof(double))
pDestAny->pData = &pDestAny->pReserved;
else
- pDestAny->pData = ::rtl_allocateMemory( sizeof(double) );
+ pDestAny->pData = std::malloc( sizeof(double) );
*static_cast<double *>(pDestAny->pData) = 0.0;
break;
case typelib_TypeClass_STRING:
@@ -339,14 +339,14 @@ inline void _copyConstructAny(
case typelib_TypeClass_EXCEPTION:
if (pTypeDescr)
{
- pDestAny->pData = ::rtl_allocateMemory( pTypeDescr->nSize );
+ pDestAny->pData = std::malloc( pTypeDescr->nSize );
_defaultConstructStruct(
pDestAny->pData, reinterpret_cast<typelib_CompoundTypeDescription *>(pTypeDescr) );
}
else
{
TYPELIB_DANGER_GET( &pTypeDescr, pType );
- pDestAny->pData = ::rtl_allocateMemory( pTypeDescr->nSize );
+ pDestAny->pData = std::malloc( pTypeDescr->nSize );
_defaultConstructStruct(
pDestAny->pData, reinterpret_cast<typelib_CompoundTypeDescription *>(pTypeDescr) );
TYPELIB_DANGER_RELEASE( pTypeDescr );
diff --git a/cppu/source/uno/destr.hxx b/cppu/source/uno/destr.hxx
index 4c017615d987..2a6f0de62000 100644
--- a/cppu/source/uno/destr.hxx
+++ b/cppu/source/uno/destr.hxx
@@ -79,19 +79,19 @@ inline void _destructAny(
case typelib_TypeClass_UNSIGNED_HYPER:
if (sizeof(void *) < sizeof(sal_Int64))
{
- ::rtl_freeMemory( pAny->pData );
+ std::free( pAny->pData );
}
break;
case typelib_TypeClass_FLOAT:
if (sizeof(void *) < sizeof(float))
{
- ::rtl_freeMemory( pAny->pData );
+ std::free( pAny->pData );
}
break;
case typelib_TypeClass_DOUBLE:
if (sizeof(void *) < sizeof(double))
{
- ::rtl_freeMemory( pAny->pData );
+ std::free( pAny->pData );
}
break;
case typelib_TypeClass_STRING:
@@ -104,7 +104,7 @@ inline void _destructAny(
case typelib_TypeClass_ANY:
OSL_FAIL( "### unexpected nested any!" );
::uno_any_destruct( static_cast<uno_Any *>(pAny->pData), release );
- ::rtl_freeMemory( pAny->pData );
+ std::free( pAny->pData );
break;
case typelib_TypeClass_TYPEDEF:
OSL_FAIL( "### unexpected typedef!" );
@@ -116,7 +116,7 @@ inline void _destructAny(
TYPELIB_DANGER_GET( &pTypeDescr, pType );
_destructStruct( pAny->pData, reinterpret_cast<typelib_CompoundTypeDescription *>(pTypeDescr), release );
TYPELIB_DANGER_RELEASE( pTypeDescr );
- ::rtl_freeMemory( pAny->pData );
+ std::free( pAny->pData );
break;
}
case typelib_TypeClass_SEQUENCE:
@@ -285,7 +285,7 @@ inline void idestroySequence(
TYPELIB_DANGER_RELEASE( pTypeDescr );
}
}
- ::rtl_freeMemory( pSeq );
+ std::free( pSeq );
}
inline void idestructSequence(
diff --git a/cppu/source/uno/sequence.cxx b/cppu/source/uno/sequence.cxx
index 513ae613c93a..1a15b1c8a8d6 100644
--- a/cppu/source/uno/sequence.cxx
+++ b/cppu/source/uno/sequence.cxx
@@ -51,11 +51,11 @@ static inline uno_Sequence * reallocSeq(
{
if (pReallocate == nullptr)
{
- pNew = static_cast<uno_Sequence *>(rtl_allocateMemory( nSize ));
+ pNew = static_cast<uno_Sequence *>(std::malloc( nSize ));
}
else
{
- pNew = static_cast<uno_Sequence *>(rtl_reallocateMemory( pReallocate, nSize ));
+ pNew = static_cast<uno_Sequence *>(std::realloc( pReallocate, nSize ));
}
if (pNew != nullptr)
{
@@ -618,7 +618,7 @@ static inline bool ireallocSequence(
pSeq->elements, pElementType,
0, nElements, release );
}
- rtl_freeMemory( pSeq );
+ std::free( pSeq );
}
*ppSequence = pNew;
}
@@ -818,7 +818,7 @@ sal_Bool SAL_CALL uno_type_sequence_reference2One(
{
// easy destruction of empty sequence:
if (osl_atomic_decrement( &pSequence->nRefCount ) == 0)
- rtl_freeMemory( pSequence );
+ std::free( pSequence );
*ppSequence = pNew;
}
}
@@ -861,7 +861,7 @@ sal_Bool SAL_CALL uno_sequence_reference2One(
{
// easy destruction of empty sequence:
if (osl_atomic_decrement( &pSequence->nRefCount ) == 0)
- rtl_freeMemory( pSequence );
+ std::free( pSequence );
*ppSequence = pNew;
}
}