[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 11:24:42 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;
     }
----------------
Does

      c->class_size = Allocator::ClassIdToSize(i);
      c->max_count = 2 * SizeClassMap::MaxCachedHint(c->class_size);

lead to less optimal code?


================
Comment at: lib/sanitizer_common/sanitizer_allocator_local_cache.h:223
       PerClass *c = &per_class_[i];
-      uptr max_cached = TransferBatch::MaxCached(i);
+      const uptr size = Allocator::ClassIdToSize(i);
+      const uptr max_cached = TransferBatch::MaxCached(size);
----------------
I think we should either use size everywhere in this function or assign c->class_size first and then use it everywhere.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D43088





More information about the llvm-commits mailing list