llvm-project/compiler-rt/lib/scudo
Kostya Kortchinsky 6f00f3b56e [scudo][standalone] mallopt runtime configuration options
Summary:
Partners have requested the ability to configure more parts of Scudo
at runtime, notably the Secondary cache options (maximum number of
blocks cached, maximum size) as well as the TSD registry options
(the maximum number of TSDs in use).

This CL adds a few more Scudo specific `mallopt` parameters that are
passed down to the various subcomponents of the Combined allocator.

- `M_CACHE_COUNT_MAX`: sets the maximum number of Secondary cached items
- `M_CACHE_SIZE_MAX`: sets the maximum size of a cacheable item in the Secondary
- `M_TSDS_COUNT_MAX`: sets the maximum number of TSDs that can be used (Shared Registry only)

Regarding the TSDs maximum count, this is a one way option, only
allowing to increase the count.

In order to allow for this, I rearranged the code to have some `setOption`
member function to the relevant classes, using the `scudo::Option` class
enum to determine what is to be set.

This also fixes an issue where a static variable (`Ready`) was used in
templated functions without being set back to `false` every time.

Reviewers: pcc, eugenis, hctim, cferris

Subscribers: jfb, llvm-commits, #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D84667
2020-07-28 11:57:54 -07:00
..
standalone [scudo][standalone] mallopt runtime configuration options 2020-07-28 11:57:54 -07:00
CMakeLists.txt [GWP-ASan] Crash Handler API. 2020-02-05 15:39:17 -08:00
scudo_allocator.cpp [GWP-ASan] Split the unwinder into segv/non-segv. 2020-07-21 08:25:37 -07:00
scudo_allocator.h [scudo][NFC] Remove unneeded template from scudo::CombinedAllocator 2019-05-01 19:36:26 +00:00
scudo_allocator_combined.h [scudo][NFC] Remove unneeded template from scudo::CombinedAllocator 2019-05-01 19:36:26 +00:00
scudo_allocator_secondary.h Update compiler-rt cpplint.py 2019-09-11 21:33:06 +00:00
scudo_crc32.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
scudo_crc32.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
scudo_errors.cpp Remove NOLINTs from compiler-rt 2019-09-11 23:19:48 +00:00
scudo_errors.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
scudo_flags.cpp Improve error message when '=' is missing in {ASAN,...}_OPTIONS. 2019-06-15 01:37:14 +00:00
scudo_flags.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
scudo_flags.inc [scudo] Tuning changes based on feedback from current use 2019-01-24 15:56:54 +00:00
scudo_interface_internal.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
scudo_malloc.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
scudo_new_delete.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
scudo_platform.h [scudo] Tuning changes based on feedback from current use 2019-01-24 15:56:54 +00:00
scudo_termination.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
scudo_tsd.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
scudo_tsd_exclusive.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
scudo_tsd_exclusive.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
scudo_tsd_shared.cpp [scudo] Correct a behavior on the shared TSD registry 2019-06-25 19:58:11 +00:00
scudo_tsd_shared.inc Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
scudo_utils.cpp Add vendor identity check for Hygon Dhyana processor in Scudo 2020-05-11 09:17:57 -07:00
scudo_utils.h Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00