summaryrefslogtreecommitdiff
path: root/registry
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 /registry
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 'registry')
-rw-r--r--registry/source/keyimpl.cxx124
-rw-r--r--registry/source/regimpl.cxx12
-rw-r--r--registry/source/regkey.cxx14
-rw-r--r--registry/test/testregcpp.cxx12
4 files changed, 81 insertions, 81 deletions
diff --git a/registry/source/keyimpl.cxx b/registry/source/keyimpl.cxx
index 75b1e7d7101d..7dcd088ceaa5 100644
--- a/registry/source/keyimpl.cxx
+++ b/registry/source/keyimpl.cxx
@@ -117,7 +117,7 @@ RegError ORegKey::openSubKeys(const OUString& keyName, RegKeyHandle** phOpenSubK
{
*phOpenSubKeys = nullptr;
*pnSubKeys = 0;
- rtl_freeMemory(pSubKeys); // @@@ leaking 'pSubKeys[0...nSubkeys-1]'
+ std::free(pSubKeys); // @@@ leaking 'pSubKeys[0...nSubkeys-1]'
return _ret; // @@@ leaking 'pKey'
}
@@ -238,17 +238,17 @@ RegError ORegKey::getValueInfo(const OUString& valueName, RegValueType* pValueTy
return RegError::VALUE_NOT_EXISTS;
}
- pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE));
+ pBuffer = static_cast<sal_uInt8*>(std::malloc(VALUE_HEADERSIZE));
sal_uInt32 readBytes;
if ( rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, readBytes) )
{
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
if (readBytes != VALUE_HEADERSIZE)
{
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
@@ -264,8 +264,8 @@ RegError ORegKey::getValueInfo(const OUString& valueName, RegValueType* pValueTy
// {
if (*pValueType > RegValueType::BINARY)
{
- rtl_freeMemory(pBuffer);
- pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(4));
+ std::free(pBuffer);
+ pBuffer = static_cast<sal_uInt8*>(std::malloc(4));
rValue.readAt(VALUE_HEADEROFFSET, pBuffer, 4, readBytes);
readUINT32(pBuffer, size);
@@ -274,7 +274,7 @@ RegError ORegKey::getValueInfo(const OUString& valueName, RegValueType* pValueTy
*pValueSize = size;
// }
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::NO_ERROR;
}
@@ -309,7 +309,7 @@ RegError ORegKey::setValue(const OUString& valueName, RegValueType vType, RegVal
sal_uInt32 size = vSize;
sal_uInt8 type = static_cast<sal_uInt8>(vType);
- pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE + size));
+ pBuffer = static_cast<sal_uInt8*>(std::malloc(VALUE_HEADERSIZE + size));
memcpy(pBuffer, &type, 1);
writeUINT32(pBuffer+VALUE_TYPEOFFSET, size);
@@ -339,17 +339,17 @@ RegError ORegKey::setValue(const OUString& valueName, RegValueType vType, RegVal
sal_uInt32 writenBytes;
if ( rValue.writeAt(0, pBuffer, VALUE_HEADERSIZE+size, writenBytes) )
{
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::SET_VALUE_FAILED;
}
if (writenBytes != (VALUE_HEADERSIZE+size))
{
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::SET_VALUE_FAILED;
}
setModified();
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::NO_ERROR;
}
@@ -381,7 +381,7 @@ RegError ORegKey::setLongListValue(const OUString& valueName, sal_Int32 const *
size += len * 4;
sal_uInt8 type = sal_uInt8(RegValueType::LONGLIST);
- pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE + size));
+ pBuffer = static_cast<sal_uInt8*>(std::malloc(VALUE_HEADERSIZE + size));
memcpy(pBuffer, &type, 1);
writeUINT32(pBuffer+VALUE_TYPEOFFSET, size);
@@ -398,17 +398,17 @@ RegError ORegKey::setLongListValue(const OUString& valueName, sal_Int32 const *
sal_uInt32 writenBytes;
if ( rValue.writeAt(0, pBuffer, VALUE_HEADERSIZE+size, writenBytes) )
{
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::SET_VALUE_FAILED;
}
if (writenBytes != (VALUE_HEADEROFFSET+size))
{
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::SET_VALUE_FAILED;
}
setModified();
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::NO_ERROR;
}
@@ -444,7 +444,7 @@ RegError ORegKey::setStringListValue(const OUString& valueName, sal_Char** pValu
}
sal_uInt8 type = sal_uInt8(RegValueType::STRINGLIST);
- pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE + size));
+ pBuffer = static_cast<sal_uInt8*>(std::malloc(VALUE_HEADERSIZE + size));
memcpy(pBuffer, &type, 1);
writeUINT32(pBuffer+VALUE_TYPEOFFSET, size);
@@ -466,17 +466,17 @@ RegError ORegKey::setStringListValue(const OUString& valueName, sal_Char** pValu
sal_uInt32 writenBytes;
if ( rValue.writeAt(0, pBuffer, VALUE_HEADERSIZE+size, writenBytes) )
{
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::SET_VALUE_FAILED;
}
if (writenBytes != (VALUE_HEADERSIZE+size))
{
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::SET_VALUE_FAILED;
}
setModified();
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::NO_ERROR;
}
@@ -512,7 +512,7 @@ RegError ORegKey::setUnicodeListValue(const OUString& valueName, sal_Unicode** p
}
sal_uInt8 type = sal_uInt8(RegValueType::UNICODELIST);
- pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE + size));
+ pBuffer = static_cast<sal_uInt8*>(std::malloc(VALUE_HEADERSIZE + size));
memcpy(pBuffer, &type, 1);
writeUINT32(pBuffer+VALUE_TYPEOFFSET, size);
@@ -534,17 +534,17 @@ RegError ORegKey::setUnicodeListValue(const OUString& valueName, sal_Unicode** p
sal_uInt32 writenBytes;
if ( rValue.writeAt(0, pBuffer, VALUE_HEADERSIZE+size, writenBytes) )
{
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::SET_VALUE_FAILED;
}
if (writenBytes != (VALUE_HEADERSIZE+size))
{
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::SET_VALUE_FAILED;
}
setModified();
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::NO_ERROR;
}
@@ -574,17 +574,17 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const
return RegError::VALUE_NOT_EXISTS;
}
- pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE));
+ pBuffer = static_cast<sal_uInt8*>(std::malloc(VALUE_HEADERSIZE));
sal_uInt32 readBytes;
if ( rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, readBytes) )
{
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
if (readBytes != VALUE_HEADERSIZE)
{
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
@@ -592,23 +592,23 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const
valueType = static_cast<RegValueType>(type);
readUINT32(pBuffer+VALUE_TYPEOFFSET, valueSize);
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
if (valueType > RegValueType::BINARY)
{
return RegError::INVALID_VALUE;
}
- pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(valueSize));
+ pBuffer = static_cast<sal_uInt8*>(std::malloc(valueSize));
if ( rValue.readAt(VALUE_HEADEROFFSET, pBuffer, valueSize, readBytes) )
{
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
if (readBytes != valueSize)
{
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
@@ -638,7 +638,7 @@ RegError ORegKey::getValue(const OUString& valueName, RegValue value) const
}
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::NO_ERROR;
}
@@ -670,21 +670,21 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue
return RegError::VALUE_NOT_EXISTS;
}
- pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE));
+ pBuffer = static_cast<sal_uInt8*>(std::malloc(VALUE_HEADERSIZE));
sal_uInt32 readBytes;
if ( rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, readBytes) )
{
pValueList = nullptr;
*pLen = 0;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
if (readBytes != VALUE_HEADERSIZE)
{
pValueList = nullptr;
*pLen = 0;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
@@ -695,13 +695,13 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue
{
pValueList = nullptr;
*pLen = 0;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
readUINT32(pBuffer+VALUE_TYPEOFFSET, valueSize);
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
/* check for 'reasonable' value */
/* surely 10 millions entry in a registry list should be enough */
@@ -709,23 +709,23 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue
{
pValueList = nullptr;
*pLen = 0;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
- pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(valueSize));
+ pBuffer = static_cast<sal_uInt8*>(std::malloc(valueSize));
if ( rValue.readAt(VALUE_HEADEROFFSET, pBuffer, valueSize, readBytes) )
{
pValueList = nullptr;
*pLen = 0;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
if (readBytes != valueSize)
{
pValueList = nullptr;
*pLen = 0;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
@@ -737,7 +737,7 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue
{
pValueList = nullptr;
*pLen = 0;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
*pLen = len;
@@ -752,7 +752,7 @@ RegError ORegKey::getLongListValue(const OUString& valueName, sal_Int32** pValue
}
*pValueList = pVList;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::NO_ERROR;
}
@@ -784,21 +784,21 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal
return RegError::VALUE_NOT_EXISTS;
}
- pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE));
+ pBuffer = static_cast<sal_uInt8*>(std::malloc(VALUE_HEADERSIZE));
sal_uInt32 readBytes;
if ( rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, readBytes) )
{
pValueList = nullptr;
*pLen = 0;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
if (readBytes != VALUE_HEADERSIZE)
{
pValueList = nullptr;
*pLen = 0;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
@@ -809,28 +809,28 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal
{
pValueList = nullptr;
*pLen = 0;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
readUINT32(pBuffer+VALUE_TYPEOFFSET, valueSize);
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
- pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(valueSize));
+ pBuffer = static_cast<sal_uInt8*>(std::malloc(valueSize));
if ( rValue.readAt(VALUE_HEADEROFFSET, pBuffer, valueSize, readBytes) )
{
pValueList = nullptr;
*pLen = 0;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
if (readBytes != valueSize)
{
pValueList = nullptr;
*pLen = 0;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
@@ -850,7 +850,7 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal
offset += 4;
- pValue = static_cast<sal_Char*>(rtl_allocateMemory(sLen));
+ pValue = static_cast<sal_Char*>(std::malloc(sLen));
readUtf8(pBuffer+offset, pValue, sLen);
pVList[i] = pValue;
@@ -858,7 +858,7 @@ RegError ORegKey::getStringListValue(const OUString& valueName, sal_Char*** pVal
}
*pValueList = pVList;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::NO_ERROR;
}
@@ -890,21 +890,21 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode***
return RegError::VALUE_NOT_EXISTS;
}
- pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(VALUE_HEADERSIZE));
+ pBuffer = static_cast<sal_uInt8*>(std::malloc(VALUE_HEADERSIZE));
sal_uInt32 readBytes;
if ( rValue.readAt(0, pBuffer, VALUE_HEADERSIZE, readBytes) )
{
pValueList = nullptr;
*pLen = 0;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
if (readBytes != VALUE_HEADERSIZE)
{
pValueList = nullptr;
*pLen = 0;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
@@ -915,28 +915,28 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode***
{
pValueList = nullptr;
*pLen = 0;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
readUINT32(pBuffer+VALUE_TYPEOFFSET, valueSize);
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
- pBuffer = static_cast<sal_uInt8*>(rtl_allocateMemory(valueSize));
+ pBuffer = static_cast<sal_uInt8*>(std::malloc(valueSize));
if ( rValue.readAt(VALUE_HEADEROFFSET, pBuffer, valueSize, readBytes) )
{
pValueList = nullptr;
*pLen = 0;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
if (readBytes != valueSize)
{
pValueList = nullptr;
*pLen = 0;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::INVALID_VALUE;
}
@@ -956,7 +956,7 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode***
offset += 4;
- pValue = static_cast<sal_Unicode*>(rtl_allocateMemory((sLen / 2) * sizeof(sal_Unicode)));
+ pValue = static_cast<sal_Unicode*>(std::malloc((sLen / 2) * sizeof(sal_Unicode)));
readString(pBuffer+offset, pValue, sLen);
pVList[i] = pValue;
@@ -964,7 +964,7 @@ RegError ORegKey::getUnicodeListValue(const OUString& valueName, sal_Unicode***
}
*pValueList = pVList;
- rtl_freeMemory(pBuffer);
+ std::free(pBuffer);
return RegError::NO_ERROR;
}
diff --git a/registry/source/regimpl.cxx b/registry/source/regimpl.cxx
index 43039fcddc29..d8a58141fce7 100644
--- a/registry/source/regimpl.cxx
+++ b/registry/source/regimpl.cxx
@@ -1369,14 +1369,14 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
break;
case RegValueType::STRING:
{
- sal_Char* value = static_cast<sal_Char*>(rtl_allocateMemory(valueSize));
+ sal_Char* value = static_cast<sal_Char*>(std::malloc(valueSize));
readUtf8(aBuffer.data(), value, valueSize);
fprintf(stdout, "%sValue: Type = RegValueType::STRING\n", indent);
fprintf(
stdout, "%s Size = %lu\n", indent,
sal::static_int_cast< unsigned long >(valueSize));
fprintf(stdout, "%s Data = \"%s\"\n", indent, value);
- rtl_freeMemory(value);
+ std::free(value);
}
break;
case RegValueType::UNICODE:
@@ -1462,7 +1462,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
offset += 4; // 4 bytes (sal_uInt32) for the string size
- sal_Char *pValue = static_cast<sal_Char*>(rtl_allocateMemory(sLen));
+ sal_Char *pValue = static_cast<sal_Char*>(std::malloc(sLen));
readUtf8(aBuffer.data() + offset, pValue, sLen);
if (offset > 8)
@@ -1471,7 +1471,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
fprintf(
stdout, "%lu = \"%s\"\n",
sal::static_int_cast< unsigned long >(i), pValue);
- rtl_freeMemory(pValue);
+ std::free(pValue);
offset += sLen;
}
}
@@ -1500,7 +1500,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
offset += 4; // 4 bytes (sal_uInt32) for the string size
- sal_Unicode *pValue = static_cast<sal_Unicode*>(rtl_allocateMemory((sLen / 2) * sizeof(sal_Unicode)));
+ sal_Unicode *pValue = static_cast<sal_Unicode*>(std::malloc((sLen / 2) * sizeof(sal_Unicode)));
readString(aBuffer.data() + offset, pValue, sLen);
if (offset > 8)
@@ -1514,7 +1514,7 @@ RegError ORegistry::dumpValue(const OUString& sPath, const OUString& sName, sal_
offset += sLen;
- rtl_freeMemory(pValue);
+ std::free(pValue);
}
}
break;
diff --git a/registry/source/regkey.cxx b/registry/source/regkey.cxx
index bf4f464d7b52..52bb9105ac92 100644
--- a/registry/source/regkey.cxx
+++ b/registry/source/regkey.cxx
@@ -154,7 +154,7 @@ RegError REGISTRY_CALLTYPE closeSubKeys(RegKeyHandle* phSubKeys,
{
(void) pReg->closeKey(phSubKeys[i]);
}
- rtl_freeMemory(phSubKeys);
+ std::free(phSubKeys);
return RegError::NO_ERROR;
}
@@ -576,7 +576,7 @@ RegError REGISTRY_CALLTYPE freeValueList(RegValueType valueType,
{
case RegValueType::LONGLIST:
{
- rtl_freeMemory(pValueList);
+ std::free(pValueList);
}
break;
case RegValueType::STRINGLIST:
@@ -584,10 +584,10 @@ RegError REGISTRY_CALLTYPE freeValueList(RegValueType valueType,
sal_Char** pVList = static_cast<sal_Char**>(pValueList);
for (sal_uInt32 i=0; i < len; i++)
{
- rtl_freeMemory(pVList[i]);
+ std::free(pVList[i]);
}
- rtl_freeMemory(pVList);
+ std::free(pVList);
}
break;
case RegValueType::UNICODELIST:
@@ -595,10 +595,10 @@ RegError REGISTRY_CALLTYPE freeValueList(RegValueType valueType,
sal_Unicode** pVList = static_cast<sal_Unicode**>(pValueList);
for (sal_uInt32 i=0; i < len; i++)
{
- rtl_freeMemory(pVList[i]);
+ std::free(pVList[i]);
}
- rtl_freeMemory(pVList);
+ std::free(pVList);
}
break;
default:
@@ -660,7 +660,7 @@ RegError REGISTRY_CALLTYPE freeKeyNames(rtl_uString** pKeyNames,
rtl_uString_release(pKeyNames[i]);
}
- rtl_freeMemory(pKeyNames);
+ std::free(pKeyNames);
return RegError::NO_ERROR;
}
diff --git a/registry/test/testregcpp.cxx b/registry/test/testregcpp.cxx
index 837e91cf3ddb..fa038c19d4d6 100644
--- a/registry/test/testregcpp.cxx
+++ b/registry/test/testregcpp.cxx
@@ -133,7 +133,7 @@ void test_coreReflection()
REG_ENSURE(!key2.setValue(OUString(), RegValueType::BINARY, (void*)pBlop, aBlopSize), "testCoreReflection error 9");
- sal_uInt8* readBlop = (sal_uInt8*)rtl_allocateMemory(aBlopSize);
+ sal_uInt8* readBlop = (sal_uInt8*)std::malloc(aBlopSize);
REG_ENSURE(!key2.getValue(OUString(), (void*)readBlop) , "testCoreReflection error 9a");
RegistryTypeReader reader(readBlop, aBlopSize, sal_True);
@@ -248,7 +248,7 @@ void test_coreReflection()
REG_ENSURE(!key5.setValue(OUString(), RegValueType::BINARY, (void*)pBlop, aBlopSize), "testCoreReflection error 9c");
- sal_uInt8* readBlop = (sal_uInt8*)rtl_allocateMemory(aBlopSize);
+ sal_uInt8* readBlop = (sal_uInt8*)std::malloc(aBlopSize);
REG_ENSURE(!key5.getValue(OUString(), (void*)readBlop) , "testCoreReflection error 9c1");
RegistryTypeReader reader(readBlop, aBlopSize, sal_True);
@@ -313,7 +313,7 @@ void test_coreReflection()
sal_uInt32 aBlopSize = writer.getBlopSize();
REG_ENSURE(!key7.setValue(OUString(), RegValueType::BINARY, (void*)pBlop, aBlopSize), "testCoreReflection error 9e");
- sal_uInt8* readBlop = (sal_uInt8*)rtl_allocateMemory(aBlopSize);
+ sal_uInt8* readBlop = (sal_uInt8*)std::malloc(aBlopSize);
REG_ENSURE(!key7.getValue(OUString(), (void*)readBlop) , "testCoreReflection error 9e2");
RegistryTypeReader reader(readBlop, aBlopSize, sal_True);
@@ -499,13 +499,13 @@ void test_registry_CppApi()
sal_Char* readValue;
REG_ENSURE(!rootKey.getValueInfo(OUString("mySecondKey"), &valueType, &valueSize), "test_registry_CppApi error 9a");
- readValue = (sal_Char*)rtl_allocateMemory(valueSize);
+ readValue = (sal_Char*)std::malloc(valueSize);
REG_ENSURE(!key2.getValue(OUString(), readValue), "test_registry_CppApi error 10");
REG_ENSURE(valueType == RegValueType::STRING, "test_registry_CppApi error 11");
REG_ENSURE(valueSize == 18, "test_registry_CppApi error 12");
REG_ENSURE(strcmp(readValue, Value) == 0, "test_registry_CppApi error 13");
- rtl_freeMemory(readValue);
+ std::free(readValue);
const sal_Char* pList[3];
const sal_Char* n1= "Hello";
@@ -550,7 +550,7 @@ void test_registry_CppApi()
(rtl_ustr_getLength(wTestValue)+1)*sizeof(sal_Unicode)), "test_registry_CppApi error 13j1");
REG_ENSURE(!rootKey.getValueInfo(OUString("mySixthKey"), &valueType, &valueSize), "test_registry_CppApi error 13j2");
- sal_Unicode* pTmpValue = (sal_Unicode*)rtl_allocateMemory(valueSize);
+ sal_Unicode* pTmpValue = (sal_Unicode*)std::malloc(valueSize);
REG_ENSURE(!rootKey.getValue(OUString("mySixthKey"), pTmpValue), "test_registry_CppApi error 13j3");
REG_ENSURE(rtl_ustr_getLength(wTestValue) == rtl_ustr_getLength(pTmpValue), "test_registry_CppApi error 13j4");
REG_ENSURE(rtl_ustr_compare(wTestValue, pTmpValue) == 0, "test_registry_CppApi error 13j4");