summaryrefslogtreecommitdiff
path: root/sal/rtl/strimp.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-08-24 16:32:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-08-27 08:47:38 +0200
commite6f4779de8fea16931967ce206439c5780d46125 (patch)
treedc898a89236247324e394815fe8bf821320c06c1 /sal/rtl/strimp.cxx
parentafd49c198769b5e7fc01a68ce7a6847aa0d0ddd8 (diff)
directly use malloc/free in sal, instead of rtl_allocateMemory/etc
now that those functions are entirely malloc/free based, we can skip a function call layer. Change-Id: Ib091de0bdf4cdd58cee45185df17d96d3e8af402 Reviewed-on: https://gerrit.libreoffice.org/59576 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sal/rtl/strimp.cxx')
-rw-r--r--sal/rtl/strimp.cxx10
1 files changed, 5 insertions, 5 deletions
diff --git a/sal/rtl/strimp.cxx b/sal/rtl/strimp.cxx
index d1651a2ad1d7..51a1a94bd705 100644
--- a/sal/rtl/strimp.cxx
+++ b/sal/rtl/strimp.cxx
@@ -65,11 +65,11 @@ bool rtl_ImplIsWhitespace( sal_Unicode c )
*/
static rtl_arena_type *pre_arena = nullptr;
-rtl_allocateStringFn rtl_allocateString = rtl_allocateMemory;
-rtl_freeStringFn rtl_freeString = rtl_freeMemory;
+rtl_allocateStringFn rtl_allocateString = malloc;
+rtl_freeStringFn rtl_freeString = free;
extern "C" {
-static void *pre_allocateStringFn(sal_Size n)
+static void *pre_allocateStringFn(size_t n)
{
sal_Size size = RTL_MEMORY_ALIGN(n + 4, 4);
char *addr = static_cast<char*>(rtl_arena_alloc(pre_arena, &size));
@@ -110,8 +110,8 @@ void SAL_CALL rtl_alloc_preInit (sal_Bool start) SAL_THROW_EXTERN_C()
else
{
rtl_arena_foreach(pre_arena, mark_static);
- rtl_allocateString = rtl_allocateMemory;
- rtl_freeString = rtl_freeMemory;
+ rtl_allocateString = malloc;
+ rtl_freeString = free;
// TODO: also re-initialize main allocator as well.
}