[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 15:02:21 PST 2018


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:
> > 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.
> After discussion, having a `const uptr size` looks safer to prevent a potential refetching. So this will stay as is.
As discussed offline, let's keep the current version and switch to 'size' in InitCache.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D43088





More information about the llvm-commits mailing list