diff options
Diffstat (limited to 'libartbase/base/utils.cc')
-rw-r--r-- | libartbase/base/utils.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libartbase/base/utils.cc b/libartbase/base/utils.cc index da53d0b99f..2c95986809 100644 --- a/libartbase/base/utils.cc +++ b/libartbase/base/utils.cc @@ -19,6 +19,7 @@ #include <dirent.h> #include <inttypes.h> #include <pthread.h> +#include <string.h> #include <sys/stat.h> #include <sys/types.h> #include <unistd.h> @@ -190,6 +191,11 @@ bool CacheOperationsMaySegFault() { #endif } +bool RunningOnVM() { + const char* on_vm = getenv("ART_TEST_ON_VM"); + return on_vm != nullptr && std::strcmp("true", on_vm) == 0; +} + uint32_t GetTid() { #if defined(__APPLE__) uint64_t owner; |