[compiler-rt] [scudo] Calling initCache() in init() of SizeClassAllocatorLocalCache (PR #71427)

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 7 13:38:07 PST 2023


ChiaHungDuan wrote:

After reviewing the logic of initialization of cache, I notice that we ensure the TSDs are initialized by [initThreadMaybe()](https://github.com/llvm/llvm-project/blob/main/compiler-rt/lib/scudo/standalone/combined.h#L220) and iff the application accesses Scudo. For threads that never allocate, it'll not initialize the TSDs. With Exclusive TSDs, even if it only does deallocation, it'll only init the `FallbackTSD` by setting `MinimalInit=true` to avoid dirtying the space of `ThreadTSD`.

Therefore, I think we are safe to do this change without introducing potential unwanted dirty pages

https://github.com/llvm/llvm-project/pull/71427


More information about the llvm-commits mailing list