[compiler-rt] 09fe23a - [gwp_asan] Use zx_system_get_page_size() on Fuchsia

Roland McGrath via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 3 10:35:18 PST 2021


Author: Roland McGrath
Date: 2021-02-03T10:35:07-08:00
New Revision: 09fe23a61c62da68ff776ec0b69cb9c7477c9ad5

URL: https://github.com/llvm/llvm-project/commit/09fe23a61c62da68ff776ec0b69cb9c7477c9ad5
DIFF: https://github.com/llvm/llvm-project/commit/09fe23a61c62da68ff776ec0b69cb9c7477c9ad5.diff

LOG: [gwp_asan] Use zx_system_get_page_size() on Fuchsia

Fuchsia is migrating to a variable page size.

Reviewed By: hctim

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

Added: 
    

Modified: 
    compiler-rt/lib/gwp_asan/platform_specific/guarded_pool_allocator_fuchsia.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/gwp_asan/platform_specific/guarded_pool_allocator_fuchsia.cpp b/compiler-rt/lib/gwp_asan/platform_specific/guarded_pool_allocator_fuchsia.cpp
index f58d4b104b39..ca5231a235f5 100644
--- a/compiler-rt/lib/gwp_asan/platform_specific/guarded_pool_allocator_fuchsia.cpp
+++ b/compiler-rt/lib/gwp_asan/platform_specific/guarded_pool_allocator_fuchsia.cpp
@@ -12,7 +12,6 @@
 #include <assert.h>
 #include <stdint.h>
 #include <string.h>
-#include <zircon/limits.h>
 #include <zircon/process.h>
 #include <zircon/syscalls.h>
 
@@ -97,7 +96,9 @@ void GuardedPoolAllocator::deallocateInGuardedPool(void *Ptr,
   Check(Status == ZX_OK, "Vmar unmapping failed");
 }
 
-size_t GuardedPoolAllocator::getPlatformPageSize() { return ZX_PAGE_SIZE; }
+size_t GuardedPoolAllocator::getPlatformPageSize() {
+  return _zx_system_get_page_size();
+}
 
 void GuardedPoolAllocator::installAtFork() {}
 } // namespace gwp_asan


        


More information about the llvm-commits mailing list