diff options
author | Alex Shlyapnikov <alekseys@google.com> | 2017-04-12 20:51:42 +0000 |
---|---|---|
committer | Alex Shlyapnikov <alekseys@google.com> | 2017-04-12 20:51:42 +0000 |
commit | d1ca180de86b6d4f0b1bd3e19c320193c2352b3e (patch) | |
tree | bc1e846cd74679bf8244703220715df1fe47e775 /lib/sanitizer_common/sanitizer_allocator_local_cache.h | |
parent | 059c103b581e37d2be47cb403769bff20808bca2 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@300103 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_allocator_local_cache.h')
-rw-r--r-- | lib/sanitizer_common/sanitizer_allocator_local_cache.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_allocator_local_cache.h b/lib/sanitizer_common/sanitizer_allocator_local_cache.h index e1172e0c2..a36619446 100644 --- a/lib/sanitizer_common/sanitizer_allocator_local_cache.h +++ b/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; |