[compiler-rt] [scudo] Remove malloc_enable_child from API. (PR #215439)

via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 10 17:55:14 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-compiler-rt-sanitizer

Author: Christopher Ferris (cferris1000)

<details>
<summary>Changes</summary>

The malloc_enable_child does not need to be a public API, instead move the function to be static and reference it that way.

---
Full diff: https://github.com/llvm/llvm-project/pull/215439.diff


1 Files Affected:

- (modified) compiler-rt/lib/scudo/standalone/wrappers_c.cpp (+3-4) 


``````````diff
diff --git a/compiler-rt/lib/scudo/standalone/wrappers_c.cpp b/compiler-rt/lib/scudo/standalone/wrappers_c.cpp
index 4398420926d6c..26df01895cb8b 100644
--- a/compiler-rt/lib/scudo/standalone/wrappers_c.cpp
+++ b/compiler-rt/lib/scudo/standalone/wrappers_c.cpp
@@ -73,6 +73,8 @@ static void reportReallocDeallocation(void *old_ptr) {
   }
 }
 
+static void enableInChildAfterFork() { Allocator.enable(/*IsChild*/ true); }
+
 extern "C" {
 
 INTERFACE WEAK void *SCUDO_PREFIX(calloc)(size_t nmemb, size_t size) {
@@ -287,15 +289,12 @@ INTERFACE WEAK int SCUDO_PREFIX(malloc_iterate)(
 INTERFACE WEAK void SCUDO_PREFIX(malloc_enable)() {
   Allocator.enable(/*IsChild*/ false);
 }
-INTERFACE WEAK void SCUDO_PREFIX(malloc_enable_child)() {
-  Allocator.enable(/*IsChild*/ true);
-}
 INTERFACE WEAK void SCUDO_PREFIX(malloc_disable)() { Allocator.disable(); }
 
 void SCUDO_PREFIX(malloc_postinit)() {
   Allocator.initGwpAsan();
   pthread_atfork(SCUDO_PREFIX(malloc_disable), SCUDO_PREFIX(malloc_enable),
-                 SCUDO_PREFIX(malloc_enable_child));
+                 enableInChildAfterFork);
 }
 
 INTERFACE WEAK int SCUDO_PREFIX(mallopt)(int param, int value) {

``````````

</details>


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


More information about the llvm-commits mailing list