[PATCH] D53975: Start adding the supporting code to perform out-of-process allocator enumeration.
Kostya Serebryany via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 1 11:59:50 PDT 2018
kcc added a comment.
OMG.
I sympathize with your problem, but the solution makes the code unreadable and unmaintainable.
The point of having templates is to avoid code like
if (ObjectView::IsLocal()) {
Also, if the change requires replacing
auto t = chunks_[i];
with the code below I can not accept such a change.
Header **header_ptr_addr = &(chunks_[i]);
// Copy header pointer into this process
typename ObjectView::template SmallAllocTy<Header *> header_ptr_view(
header_ptr_addr);
Header *t = *(header_ptr_view.GetLocalAddress());
Is there a reasonable way to replace it with this?
auto t = Load(&chunks_[i]);
If not, you may need to find completely different way, e.g. not changing the allocator code at all and instead doing the introspection in an independent part of code.
Whenever the allocator data layout changes, you will have to change that code too, but with proper tests you will at least know when you need to do it.
Repository:
rCRT Compiler Runtime
https://reviews.llvm.org/D53975
More information about the llvm-commits
mailing list