From: Alex Shlyapnikov Date: Wed, 12 Apr 2017 20:51:42 +0000 (+0000) Subject: Avoid calling SizeClassMap::MaxCachedHint on hot path, it's not free. X-Git-Tag: llvmorg-5.0.0-rc1~7901 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=05bf27ac3f560cc798b20a352450d3b6bc20e72b;p=platform%2Fupstream%2Fllvm.git Avoid calling SizeClassMap::MaxCachedHint on hot path, it's not free. Summary: Remove unecessary SizeClassMap::MaxCachedHint call. Reviewers: eugenis Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D31989 llvm-svn: 300103 --- diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_local_cache.h b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_local_cache.h index e1172e0..a366194 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_allocator_local_cache.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_allocator_local_cache.h @@ -102,7 +102,7 @@ struct SizeClassAllocator64LocalCache { NOINLINE void Refill(PerClass *c, SizeClassAllocator *allocator, uptr class_id) { InitCache(); - uptr num_requested_chunks = SizeClassMap::MaxCachedHint(class_id); + uptr num_requested_chunks = c->max_count / 2; allocator->GetFromAllocator(&stats_, class_id, c->chunks, num_requested_chunks); c->count = num_requested_chunks;