[PATCH] D43088: [sanitizer] Size class map & local cache improvements
Aleksey Shlyapnikov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 9 14:21:44 PST 2018
alekseyshl accepted this revision.
alekseyshl added inline comments.
================
Comment at: lib/sanitizer_common/sanitizer_allocator_local_cache.h:101
+ c->max_count = 2 * SizeClassMap::MaxCachedHint(size);
+ c->class_size = size;
}
----------------
cryptoad wrote:
> alekseyshl wrote:
> > Does
> >
> > c->class_size = Allocator::ClassIdToSize(i);
> > c->max_count = 2 * SizeClassMap::MaxCachedHint(c->class_size);
> >
> > lead to less optimal code?
> It leads to almost exactly the same asm (at least for x64).
> Do you prefer yours?
Yep, mine is more concise.
================
Comment at: lib/sanitizer_common/sanitizer_allocator_local_cache.h:234
} else {
c->batch_class_id = (c->class_size <
TransferBatch::AllocationSizeRequiredForNElements(max_cached)) ?
----------------
cryptoad wrote:
> If keeping the size construct, I can use size instead of c->class_size here.
Please do
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D43088
More information about the llvm-commits
mailing list