Xamarin Public Jenkins (auto-signing) 468663ddbb Imported Upstream version 6.10.0.49
Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
2020-01-16 16:38:04 +00:00

16 lines
374 B
C

#if __LP64__
# define SANITIZER_WORDSIZE 64
#else
# define SANITIZER_WORDSIZE 32
#endif
// This is a simplified version of GetMaxVirtualAddress function.
unsigned long SystemVMA () {
#if SANITIZER_WORDSIZE == 64
unsigned long vma = (unsigned long)__builtin_frame_address(0);
return SANITIZER_WORDSIZE - __builtin_clzll(vma);
#else
return SANITIZER_WORDSIZE;
#endif
}