summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2012-12-05 07:11:47 +0000
committerKostya Serebryany <kcc@google.com>2012-12-05 07:11:47 +0000
commit0afbb325b67b7891fb53641c6d3b245247c19d4c (patch)
tree60d929b298a0707e1d55201796d9276b135b906d
parent510e606e197c05b88bb19bd5865d9877a1178f4d (diff)
downloadbcm5719-llvm-0afbb325b67b7891fb53641c6d3b245247c19d4c.tar.gz
bcm5719-llvm-0afbb325b67b7891fb53641c6d3b245247c19d4c.zip
[tsan] make the 64-bit allocator build (but not work) in 32-bit mode to simplify the code and test structure and allow further refactoring
llvm-svn: 169361
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_allocator64.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator64.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator64.h
index 768679661f4..f2e13af2008 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator64.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator64.h
@@ -20,12 +20,10 @@
#include "sanitizer_allocator.h"
-#if SANITIZER_WORDSIZE != 64
-# error "sanitizer_allocator64.h can only be used on 64-bit platforms"
-#endif
-
namespace __sanitizer {
+// SizeClassAllocator64 -- allocator for 64-bit address space.
+//
// Space: a portion of address space of kSpaceSize bytes starting at
// a fixed address (kSpaceBeg). Both constants are powers of two and
// kSpaceBeg is kSpaceSize-aligned.
@@ -143,10 +141,11 @@ class SizeClassAllocator64 {
static const uptr kNumClasses = SizeClassMap::kNumClasses; // 2^k <= 256
private:
+ static const uptr kRegionSize = kSpaceSize / kNumClasses;
COMPILER_CHECK(kSpaceBeg % kSpaceSize == 0);
COMPILER_CHECK(kNumClasses <= SizeClassMap::kNumClasses);
- static const uptr kRegionSize = kSpaceSize / kNumClasses;
- COMPILER_CHECK((kRegionSize >> 32) > 0); // kRegionSize must be >= 2^32.
+ // kRegionSize must be >= 2^32.
+ COMPILER_CHECK((kRegionSize) >= (1ULL << (SANITIZER_WORDSIZE / 2)));
// Populate the free list with at most this number of bytes at once
// or with one element if its size is greater.
static const uptr kPopulateSize = 1 << 18;
OpenPOWER on IntegriCloud