[PATCH] D43088: [sanitizer] Size class map & local cache improvements

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 13:40:23 PST 2018


cryptoad created this revision.
cryptoad added reviewers: alekseyshl, tl0gic.
Herald added subscribers: Sanitizers, delcypher, kubamracek.

- Reland https://reviews.llvm.org/rL324263, this time allowing for a compile-time decision as to whether or not use the 32-bit division. A single test is using a class map covering a maximum size greater than 4GB, this can be checked via the template parameters, and allows SizeClassAllocator64PopulateFreeListOOM to pass;
- `MaxCachedHint` is always called on a class id for which we have already computed the size, but we still recompute `Size(class_id)`. Change the prototype of the function to work on sizes instead of class ids. This also allows us to get rid of the `kBatchClassID` special case. Update the callers accordingly;
- `InitCache` and `Drain` will start iterating at index 1: index 0 contents are unused and can safely be left to be 0. Plus we do not pay the cost of going through an `UNLIKELY` in `MaxCachedHint`, and touching memory that is otherwise not used;
- `const` some variables in the areas modified;
- Remove an spurious extra line at the end of a file.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D43088

Files:
  lib/sanitizer_common/sanitizer_allocator_local_cache.h
  lib/sanitizer_common/sanitizer_allocator_primary32.h
  lib/sanitizer_common/sanitizer_allocator_size_class_map.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D43088.133483.patch
Type: text/x-patch
Size: 7414 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180208/f9eb4ca6/attachment.bin>


More information about the llvm-commits mailing list