summaryrefslogtreecommitdiff
path: root/sal/rtl/strtmpl.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2017-12-07 21:19:09 +0000
committerMichael Meeks <michael.meeks@collabora.com>2017-12-15 10:22:03 +0000
commit556e121379494d4bed9738d9c7539ac5afc8f6f4 (patch)
tree26ac1061ee6916376bf2906b3259f5a067c7b3b3 /sal/rtl/strtmpl.cxx
parent6d03c1367f0955900194287805324a8b4144e124 (diff)
sal: add pre-initialization scheme for allocations.
This saves several megabytes of dirtied pages for each LOK client of Online. Change-Id: I425a2e7896879f0a64d71fcc0655e9e1fa1256aa
Diffstat (limited to 'sal/rtl/strtmpl.cxx')
-rw-r--r--sal/rtl/strtmpl.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sal/rtl/strtmpl.cxx b/sal/rtl/strtmpl.cxx
index 62bb76ddfdd1..5fdab82f8b43 100644
--- a/sal/rtl/strtmpl.cxx
+++ b/sal/rtl/strtmpl.cxx
@@ -1149,7 +1149,7 @@ static IMPL_RTL_STRINGDATA* IMPL_RTL_STRINGNAME( ImplAlloc )( sal_Int32 nLen )
= (sal::static_int_cast< sal_uInt32 >(nLen)
<= ((SAL_MAX_UINT32 - sizeof (IMPL_RTL_STRINGDATA))
/ sizeof (IMPL_RTL_STRCODE)))
- ? static_cast<IMPL_RTL_STRINGDATA *>(rtl_allocateMemory(
+ ? static_cast<IMPL_RTL_STRINGDATA *>(rtl_allocateString(
sizeof (IMPL_RTL_STRINGDATA) + nLen * sizeof (IMPL_RTL_STRCODE)))
: nullptr;
if (pData != nullptr) {
@@ -1230,7 +1230,7 @@ void SAL_CALL IMPL_RTL_STRINGNAME( release )( IMPL_RTL_STRINGDATA* pThis )
if ( !osl_atomic_decrement( &(pThis->refCount) ) )
{
RTL_LOG_STRING_DELETE( pThis );
- rtl_freeMemory( pThis );
+ rtl_freeString( pThis );
}
}