[PATCH] D74364: [GWP-ASan] Update alignment on Android.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 10 15:29:17 PST 2020


eugenis accepted this revision.
eugenis added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp:17
 extern "C" GWP_ASAN_WEAK void android_set_abort_message(const char *);
-#else // ANDROID
+#else // __BIONIC
 #include <stdio.h>
----------------
missing __ at the end


================
Comment at: compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp:57
+#ifdef __BIONIC__
+Alignment PlatformDefaultAlignment = Alignment::EIGHT_THEN_SIXTEEN;
+#else  // __BIONIC__
----------------
static constexpr


================
Comment at: compiler-rt/lib/gwp_asan/platform_specific/utilities_posix.cpp:62
+
+size_t alignedAllocationSize(size_t RealAllocationSize, Alignment Align) {
+  assert(RealAllocationSize > 0);
----------------
rename to "rightAlignedAllocationSize"? Otherwise it's not clear what the allocation size has to do with alignment.


================
Comment at: compiler-rt/lib/gwp_asan/utilities.h:19
+
+enum class Alignment {
+  // Default => POWER_OF_TWO on most platforms, EIGHT_THEN_SIXTEEN on Android.
----------------
alignment is usually the actual number in bytes.
Call this AlignmentPolicy or something.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D74364/new/

https://reviews.llvm.org/D74364





More information about the llvm-commits mailing list