OSDN Git Service

base: add SafeCopy.
authorJosh Gao <jmgao@google.com>
Tue, 18 Apr 2017 01:31:26 +0000 (18:31 -0700)
committerJosh Gao <jmgao@google.com>
Tue, 18 Apr 2017 21:04:20 +0000 (14:04 -0700)
commit682282eaac86202652e17752ef32f14c89e2ccda
treec779c7a48e7fa41b4aad0cb1f7bb4953fde241cc
parentc36a970fcd4878eafd03d41eeff0a4cbdd400326
base: add SafeCopy.

Add a function that uses process_vm_readv on Linux to safely
dereference pointers without the risk of segfault.

Bug: http://b/30836730
Test: safe_copy_test on host
Change-Id: I10bafcffe2172e17b00f65455d1dd6a08aa631d7
runtime/Android.bp
runtime/base/safe_copy.cc [new file with mode: 0644]
runtime/base/safe_copy.h [new file with mode: 0644]
runtime/base/safe_copy_test.cc [new file with mode: 0644]