diff options
| author | Timur Iskhodzhanov <timurrrr@google.com> | 2013-02-08 12:02:00 +0000 |
|---|---|---|
| committer | Timur Iskhodzhanov <timurrrr@google.com> | 2013-02-08 12:02:00 +0000 |
| commit | 167f9e4395e029b98e97e10c2643c94404d37c84 (patch) | |
| tree | 29dfdfed8fdecfdd7db85413aeff109d78d05802 /compiler-rt/lib/sanitizer_common/sanitizer_allocator.h | |
| parent | 659bca56a707f036651a51d7d6943eb1c719200c (diff) | |
| download | bcm5719-llvm-167f9e4395e029b98e97e10c2643c94404d37c84.tar.gz bcm5719-llvm-167f9e4395e029b98e97e10c2643c94404d37c84.zip | |
[ASan] Switch Windows to allocator v2, also fixing some build errors
llvm-svn: 174707
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_allocator.h')
| -rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_allocator.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h index c0d7b5e2d9a..48e5b1afc40 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h @@ -121,7 +121,7 @@ class SizeClassMap { if (size <= kMidSize) return (size + kMinSize - 1) >> kMinSizeLog; if (size > kMaxSize) return 0; - uptr l = SANITIZER_WORDSIZE - 1 - __builtin_clzl(size); + uptr l = MostSignificantSetBitIndex(size); uptr hbits = (size >> (l - S)) & M; uptr lbits = size & ((1 << (l - S)) - 1); uptr l1 = l - kMidSizeLog; @@ -143,7 +143,7 @@ class SizeClassMap { Printf("\n"); uptr d = s - prev_s; uptr p = prev_s ? (d * 100 / prev_s) : 0; - uptr l = SANITIZER_WORDSIZE - 1 - __builtin_clzl(s); + uptr l = MostSignificantSetBitIndex(s); uptr cached = MaxCached(i) * s; Printf("c%02zd => s: %zd diff: +%zd %02zd%% l %zd " "cached: %zd %zd; id %zd\n", @@ -886,7 +886,7 @@ class LargeMmapAllocator { h->size = size; h->map_beg = map_beg; h->map_size = map_size; - uptr size_log = SANITIZER_WORDSIZE - __builtin_clzl(map_size) - 1; + uptr size_log = MostSignificantSetBitIndex(map_size); CHECK_LT(size_log, ARRAY_SIZE(stats.by_size_log)); { SpinMutexLock l(&mutex_); |

