[PATCH] D61745: [scudo][standalone] Introduce the Primary(s) and LocalCache
Matt Morehouse via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 14 12:05:22 PDT 2019
morehouse added inline comments.
================
Comment at: lib/scudo/standalone/local_cache.h:17
+
+template <class SizeClassAllocator> struct SizeClassAllocatorLocalCache {
+ typedef typename SizeClassAllocator::SizeClassMap SizeClassMap;
----------------
Local cache and SizeClassAllocator are very tightly coupled. It's pretty difficult to understand what's going on.
For example, a call to `SizeClassAllocatorLocalCache::allocate` takes a `SizeClassAllocator` as a param and may call `popBatch` on that allocator. `popBatch` takes the current `SizeClassAllocatorLocalCache` as a param and passes it down through `populateFreeList` and `populateBatch` which may then call `SizeClassAllocatorLocalCache::createBatch`. `createBatch` may call `allocate`, which may then call into `SizeClassAllocator::popBatch`. Which makes a very confusing and ugly cycle in the call graph (whether it can happen in practice or not).
Surely there's a less convoluted way to implement this...
Repository:
rCRT Compiler Runtime
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D61745/new/
https://reviews.llvm.org/D61745
More information about the llvm-commits
mailing list