[PATCH] D56207: Update allocator unit tests to test the `RemoteAddressSpaceView` template instantiation.

Dan Liew via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 14 09:02:15 PST 2019


delcypher marked an inline comment as done.
delcypher added inline comments.


================
Comment at: lib/sanitizer_common/tests/sanitizer_allocator_test.cc:696
+        AllocatorRemoteView *a_remote_view =
+            reinterpret_cast<AllocatorRemoteView *>(a);
+        // Create in-process VMReadContext object.
----------------
vitalybuka wrote:
> How are we going init AllocatorRemoteView in production code?
It's not too far from what's in the test. In production we will use `VMReadContext::read(...)` to copy an in-use allocator from the target sanitizer process into the local process and then perform the `reinterpret_cast` just like this test does.

We can't write this test to actually use a remote allocator very easily so we just use a local one and check that `RemoteAddressSpaceView` works as expected with local memory.

A different test that tests the production workflow will be submitted in a different patch.


Repository:
  rCRT Compiler Runtime

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D56207/new/

https://reviews.llvm.org/D56207





More information about the llvm-commits mailing list