[compiler-rt] [scudo] Remove ResidentMemorySize test. (PR #145955)

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 26 22:36:19 PDT 2025


vitalybuka wrote:

This is the only test which detect change like this, and we have qemu bug was broken in exactly like this. So I believe it's still useful.

```
--- a/compiler-rt/lib/scudo/standalone/mem_map_linux.cpp
+++ b/compiler-rt/lib/scudo/standalone/mem_map_linux.cpp
@@ -122,8 +122,9 @@ void MemMapLinux::setMemoryPermissionImpl(uptr Addr, uptr Size, uptr Flags) {
 void MemMapLinux::releaseAndZeroPagesToOSImpl(uptr From, uptr Size) {
   void *Addr = reinterpret_cast<void *>(From);
 
-  while (madvise(Addr, Size, MADV_DONTNEED) == -1 && errno == EAGAIN) {
-  }
+  memset((void*)(Addr), 0, Size);
+  // while (madvise(Addr, Size, MADV_DONTNEED) == -1 && errno == EAGAIN) {
+  // }
 }
 
 bool ReservedMemoryLinux::createImpl(uptr Addr, uptr Size, const char *Name,
```

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


More information about the llvm-commits mailing list