summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2012-12-11 14:41:31 +0000
committerKostya Serebryany <kcc@google.com>2012-12-11 14:41:31 +0000
commit90a59fafc01d8ec7dfe38f3376c1bf10b5a4fa39 (patch)
treed869927afd124e39eec30ccd3110948768169ee0 /compiler-rt/lib/sanitizer_common
parente55382ea5557092feeec15fd9b2b7a2f67e83c24 (diff)
downloadbcm5719-llvm-90a59fafc01d8ec7dfe38f3376c1bf10b5a4fa39.tar.gz
bcm5719-llvm-90a59fafc01d8ec7dfe38f3376c1bf10b5a4fa39.zip
[asan] more code for asan_allocator2: basic Allocate/Deallocate code
llvm-svn: 169864
Diffstat (limited to 'compiler-rt/lib/sanitizer_common')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_common.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common.h b/compiler-rt/lib/sanitizer_common/sanitizer_common.h
index 77fcc5cd6dd..a7eed696d1d 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common.h
@@ -160,6 +160,9 @@ INLINE uptr RoundUpTo(uptr size, uptr boundary) {
CHECK(IsPowerOfTwo(boundary));
return (size + boundary - 1) & ~(boundary - 1);
}
+INLINE bool IsAligned(uptr a, uptr alignment) {
+ return (a & (alignment - 1)) == 0;
+}
// Don't use std::min, std::max or std::swap, to minimize dependency
// on libstdc++.
template<class T> T Min(T a, T b) { return a < b ? a : b; }
OpenPOWER on IntegriCloud