[asan] make __asan::Deallocate immune to racy double-free (issue #57)
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@154097 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/asan/asan_win.cc b/lib/asan/asan_win.cc
index 94f4d04..baa8268 100644
--- a/lib/asan/asan_win.cc
+++ b/lib/asan/asan_win.cc
@@ -234,6 +234,10 @@
return InterlockedExchangeAdd((LONG*)a, 1) + 1;
}
+uint16_t AtomicExchange(uint16_t *a, uint16_t new_val) {
+ return InterlockedExchange16(a, new_val);
+}
+
const char* AsanGetEnv(const char* name) {
static char env_buffer[32767] = {};