[PATCH] D53975: Start adding the supporting code to perform out-of-process allocator enumeration.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 12 02:04:09 PST 2018


delcypher added a comment.

In https://reviews.llvm.org/D53975#1293500, @kcc wrote:

> AddressSpaceView::Load sounds great. 
>  You can go further and rename Load to operator(), then declare a member
>
>   AddressSpaceView Load;
>
> such that the code would look like
>
>   Load(chunks[i])
>   
>
> but that's up to you.


If we make `AddressSpaceView` an instance member because it will change the data layout of the allocator (the out-of-process version of `AddressSpaceView` will not be zero sized, unlike the in-process version). This is something we cannot allow. However, we could make it a static member I suppose which won't affect data layout. I need to use this `AddressSpaceView` in other places outside of a class and I'm a little worried how it will look there. I'd rather stick with the `Load` method for now and apply your suggested transformation in later commits if it turns out to be necessary.

> Please add comments and tests. 
>  Are you planing to add the rest of the code to this change, or commit it separately? (either works)

There are many parts to this change which I'm going to have to land as separate commits. Here's my rough plan

1. Put up a change for each allocator change required for `ForEachChunk()`. At this point we won't introduce the out-of-process version of `AddressSpaceView` and will rely on the existing allocator unit tests. If there are missing allocator unit tests I will add them. This might seem odd choice but the out-of-process version of `AddressSpaceView` simply isn't ready yet (the requirements have changed which my old implementation cannot meet). However I know what the allocator changes will need to be so I can have those sitting in the review pipeline while I implement the out-of-process version of `AddressSpaceView`.

2. Start a review sketching a design for how to implement `LSanChunkView` and `ASanChunkView` out-of-process. This is another major part of the work because being able to do `ForEachChunk` out-of-process isn't useful on its own. We need a way to know what the state of each enumerated chunk is.

3. Put up for review an out-of-process of `AddressSpaceView`. This will include unit tests to make sure the allocator can be instantiated with this other type and that enumeration still works.

4. Put up for review the Darwin specific code that will use the new out-of-process interfaces. This will include a Darwin only "system test" that exercises all the newly introduced code.

I'm going to tweak this change a bit so that it is a change for the Secondary allocator. Separate changes will follow.


Repository:
  rCRT Compiler Runtime

https://reviews.llvm.org/D53975





More information about the llvm-commits mailing list