Introduce ReservedAddressRange to sanitizer_common.
authorKostya Kortchinsky <kostyak@google.com>
Mon, 30 Oct 2017 17:56:24 +0000 (17:56 +0000)
committerKostya Kortchinsky <kostyak@google.com>
Mon, 30 Oct 2017 17:56:24 +0000 (17:56 +0000)
commit96da9fa4ca74b98acfbca63b59fb17c469cbad1c
tree7aa9db66534effdb9c041216d55115383ff7ca78
parent5da11dfd2400c8e3e6dffa34643e7967b57f8060
Introduce ReservedAddressRange to sanitizer_common.

Summary:
Fixed version of https://reviews.llvm.org/D38437 (fixes Win/Fuchsia failures).

Creating a new revision, since the old one was getting a bit old/crowded.

    In Fuchsia, MmapNoAccess/MmapFixedOrDie are implemented using a global
    VMAR, which means that MmapNoAccess can only be called once. This works
    for the sanitizer allocator but *not* for the Scudo allocator.

    Hence, this changeset introduces a new ReservedAddressRange object to
    serve as the new API for these calls. In this changeset, the object
    still calls into the old Mmap implementations.

    The next changeset two changesets will convert the sanitizer and scudo
    allocators to use the new APIs, respectively. (ReservedAddressRange will
    replace the SecondaryHeader in Scudo.)

    Finally, a last changeset will update the Fuchsia implementation.

Reviewers: alekseyshl, cryptoad, phosek

Reviewed By: alekseyshl, cryptoad

Subscribers: kubamracek

Differential Revision: https://reviews.llvm.org/D39072

llvm-svn: 316934
compiler-rt/lib/sanitizer_common/sanitizer_common.h
compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cc
compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc
compiler-rt/lib/sanitizer_common/sanitizer_win.cc
compiler-rt/lib/sanitizer_common/tests/sanitizer_common_test.cc