diff options
Diffstat (limited to 'sal/rtl/strimp.cxx')
-rw-r--r-- | sal/rtl/strimp.cxx | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/sal/rtl/strimp.cxx b/sal/rtl/strimp.cxx index e356a4e921a6..d1651a2ad1d7 100644 --- a/sal/rtl/strimp.cxx +++ b/sal/rtl/strimp.cxx @@ -94,36 +94,26 @@ static void mark_static(void *addr, sal_Size /* size */) str->refCount |= SAL_STRING_STATIC_FLAG; } -void SAL_CALL rtl_alloc_preInit (rtl_alloc_preInit_phase_t phase) SAL_THROW_EXTERN_C() +void SAL_CALL rtl_alloc_preInit (sal_Bool start) SAL_THROW_EXTERN_C() { - switch (phase) + if (start) { - case rtlAllocPreInitStart: - { - rtl_allocateString = pre_allocateStringFn; - rtl_freeString = pre_freeStringFn; - pre_arena = rtl_arena_create("pre-init strings", 4, 0, - nullptr, rtl_arena_alloc, - rtl_arena_free, 0); - - // To be consistent (and to ensure the rtl_cache threads are started). - ensureCacheSingleton(); - } - break; - - case rtlAllocPreInitEnd: - // back to normal - { - rtl_arena_foreach(pre_arena, mark_static); - rtl_allocateString = rtl_allocateMemory; - rtl_freeString = rtl_freeMemory; - - // TODO: also re-initialize main allocator as well. - } - break; - - case rtlAllocPostInit: // no longer used - break; + rtl_allocateString = pre_allocateStringFn; + rtl_freeString = pre_freeStringFn; + pre_arena = rtl_arena_create("pre-init strings", 4, 0, + nullptr, rtl_arena_alloc, + rtl_arena_free, 0); + + // To be consistent (and to ensure the rtl_cache threads are started). + ensureCacheSingleton(); + } + else + { + rtl_arena_foreach(pre_arena, mark_static); + rtl_allocateString = rtl_allocateMemory; + rtl_freeString = rtl_freeMemory; + + // TODO: also re-initialize main allocator as well. } } |