Skip to content

Commit

Permalink
[tsan] make the 64-bit allocator build (but not work) in 32-bit mode …
Browse files Browse the repository at this point in the history
…to simplify the code and test structure and allow further refactoring

git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@169361 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
kcc committed Dec 5, 2012
1 parent 7385f8b commit da6ce04
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions lib/sanitizer_common/sanitizer_allocator64.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit da6ce04

Please sign in to comment.