[compiler-rt] [scudo] Add primary option to zero block on dealloc. (PR #142394)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 3 21:57:51 PDT 2025
================
@@ -114,6 +114,15 @@ PRIMARY_OPTIONAL_TYPE(ConditionVariableT, ConditionVariableDummy)
// to, in increments of a power-of-2 scale. See `CompactPtrScale` also.
PRIMARY_OPTIONAL_TYPE(CompactPtrT, uptr)
+// When enabled, chunk contents are zeroed out on deallocation. This can be
+// beneficial for security (to prevent information leaks) and for memory usage
+// on some systems where pages filled with zeroes can be decommitted by the OS
+// or better compressed by features like zram.
+PRIMARY_OPTIONAL(const bool, EnableZeroOnDealloc, false)
+// Only chunks smaller or equal to this threshold will be zeroed on
+// deallocation. Requires zero on dealloc to be enabled.
+PRIMARY_OPTIONAL(const s32, DefaultZeroOnDeallocMaxSize, INT32_MAX)
----------------
ChiaHungDuan wrote:
```suggestion
PRIMARY_OPTIONAL(const s32, ZeroOnDeallocMaxSize, INT32_MAX)
```
https://github.com/llvm/llvm-project/pull/142394
More information about the llvm-commits
mailing list