Release the shadow memory used by the mmap range at munmap
authorJianzhou Zhao <jianzhouzh@google.com>
Thu, 1 Oct 2020 18:05:34 +0000 (18:05 +0000)
committerJianzhou Zhao <jianzhouzh@google.com>
Fri, 2 Oct 2020 20:17:22 +0000 (20:17 +0000)
commit045a620c455d2f27a536d687ee6a0299b9e2c734
treebed7811735bb2a871beacc4e368ba047acec31ca
parent11622d0fed8c1fb99124ebf4a6aece4bcc83b367
Release the shadow memory used by the mmap range at munmap

When an application does a lot of pairs of mmap and munmap, if we did
not release shadoe memory used by mmap addresses, this would increase
memory usage.

Reviewed-by: morehouse
Differential Revision: https://reviews.llvm.org/D88686
compiler-rt/lib/dfsan/dfsan_interceptors.cpp
compiler-rt/test/dfsan/munmap_release_shadow.c [new file with mode: 0644]