diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2017-12-07 21:19:09 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2017-12-15 10:22:03 +0000 |
commit | 556e121379494d4bed9738d9c7539ac5afc8f6f4 (patch) | |
tree | 26ac1061ee6916376bf2906b3259f5a067c7b3b3 /include/rtl | |
parent | 6d03c1367f0955900194287805324a8b4144e124 (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 'include/rtl')
-rw-r--r-- | include/rtl/alloc.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/rtl/alloc.h b/include/rtl/alloc.h index bd3149fece87..cb4f09cbb67c 100644 --- a/include/rtl/alloc.h +++ b/include/rtl/alloc.h @@ -286,6 +286,43 @@ SAL_DLLPUBLIC void SAL_CALL rtl_cache_free ( ) SAL_THROW_EXTERN_C(); +#ifdef LIBO_INTERNAL_ONLY + +/** @cond INTERNAL */ +/** rtl_alloc_preInit + * + * This function, is called at the beginning and again + * at the end of LibreOfficeKit pre-initialization to enable + * various optimizations. + * + * Its function is to annotate a section @start = true to + * end (@start = false) via. two calls. Inside this section + * string allocators are replaced with ones which cause the + * strings to be staticized at the end of the section. + * + * This brings a number of constraints - in particular no + * string allocated outside the section should be freed + * inside it, practically this means starting the section + * as early as possible. No string allocated inside the + * section will be freed subsequently as they are + * staticized. + * + * This method is not thread-safe, nor intended for use in + * a threaded context, cf. previous constraints. + * + * It is almost certainly not the method that you want, + * use with extraordinary care referring to the + * implementation. + * + * @since LibreOffice 6.1 + */ +SAL_DLLPUBLIC void SAL_CALL rtl_alloc_preInit ( + sal_Bool start +) SAL_THROW_EXTERN_C(); +/** @endcond */ + +#endif + #ifdef __cplusplus } #endif |