diff options
author | Kostya Kortchinsky <kostyak@google.com> | 2017-11-13 20:38:22 +0000 |
---|---|---|
committer | Kostya Kortchinsky <kostyak@google.com> | 2017-11-13 20:38:22 +0000 |
commit | 82cd00ab016a2197f9fa26d38fbfdad75af76c31 (patch) | |
tree | 3b856bf497142c96229afd50514e9f999447acc7 /lib/sanitizer_common/sanitizer_fuchsia.cc | |
parent | 496a3c65879fad22aa7a878e657f74cf6422d22c (diff) |
[sanitizer] Update scudo to use new API
Summary:
The ScudoAllocator uses a SecondaryHeader to keep track of the size and base address of each mmap'd chunk.
This aligns well with what the ReservedAddressRange is trying to do. This changeset converts the scudo allocator from using the MmapNoAccess/MmapFixed APIs to the ReservedAddressRange::Init and ::Map APIs. In doing so, it replaces the SecondayHeader struct with the ReservedAddressRange object.
This is part 3 of a 4 part changeset; part 1 https://reviews.llvm.org/D39072 and part 2 https://reviews.llvm.org/D38592
Reviewers: alekseyshl, mcgrathr, cryptoad, phosek
Reviewed By: cryptoad
Subscribers: llvm-commits, cryptoad, kubamracek
Differential Revision: https://reviews.llvm.org/D38593
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@318080 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_fuchsia.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_fuchsia.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_fuchsia.cc b/lib/sanitizer_common/sanitizer_fuchsia.cc index c03c9939c..c130c10c2 100644 --- a/lib/sanitizer_common/sanitizer_fuchsia.cc +++ b/lib/sanitizer_common/sanitizer_fuchsia.cc @@ -266,6 +266,10 @@ void ReservedAddressRange::Unmap(uptr addr, uptr size) { CHECK((addr_as_void == base_) || (addr + size == base_as_uptr + size_)); CHECK_LE(size, size_); UnmapOrDie(reinterpret_cast<void*>(addr), size); + if (addr_as_void == base_) { + base_ = reinterpret_cast<void*>(addr + size); + } + size_ = size_ - size; } // MmapNoAccess and MmapFixedOrDie are used only by sanitizer_allocator. |