[PATCH] D61745: [scudo][standalone] Introduce the Primary(s) and LocalCache

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 14:08:19 PDT 2019


cryptoad added inline comments.


================
Comment at: lib/scudo/standalone/local_cache.h:17
+
+template <class SizeClassAllocator> struct SizeClassAllocatorLocalCache {
+  typedef typename SizeClassAllocator::SizeClassMap SizeClassMap;
----------------
morehouse wrote:
> 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...
Right, this is fairly intricate and entangled. I'm going to see if I can sort this out.


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