summaryrefslogtreecommitdiff
path: root/lib/msan
diff options
context:
space:
mode:
Diffstat (limited to 'lib/msan')
-rw-r--r--lib/msan/msan_allocator.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/msan/msan_allocator.cc b/lib/msan/msan_allocator.cc
index a82e89845..6c389f008 100644
--- a/lib/msan/msan_allocator.cc
+++ b/lib/msan/msan_allocator.cc
@@ -33,9 +33,12 @@ struct MsanMapUnmapCallback {
// We are about to unmap a chunk of user memory.
// Mark the corresponding shadow memory as not needed.
- ReleaseMemoryToOS(MEM_TO_SHADOW(p), size);
- if (__msan_get_track_origins())
- ReleaseMemoryToOS(MEM_TO_ORIGIN(p), size);
+ uptr shadow_p = MEM_TO_SHADOW(p);
+ ReleaseMemoryPagesToOS(shadow_p, shadow_p + size);
+ if (__msan_get_track_origins()) {
+ uptr origin_p = MEM_TO_ORIGIN(p);
+ ReleaseMemoryPagesToOS(origin_p, origin_p + size);
+ }
}
};