diff options
Diffstat (limited to 'libsanitizer/tsan/tsan_defs.h')
-rw-r--r-- | libsanitizer/tsan/tsan_defs.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libsanitizer/tsan/tsan_defs.h b/libsanitizer/tsan/tsan_defs.h index c14a6d19623..6683a4e1abb 100644 --- a/libsanitizer/tsan/tsan_defs.h +++ b/libsanitizer/tsan/tsan_defs.h @@ -137,6 +137,12 @@ T RoundDown(T p, u64 align) { return (T)((u64)p & ~(align - 1)); } +// Zeroizes high part, returns 'bits' lsb bits. +template<typename T> +T GetLsb(T v, int bits) { + return (T)((u64)v & ((1ull << bits) - 1)); +} + struct MD5Hash { u64 hash[2]; bool operator==(const MD5Hash &other) const; |