[llvm-commits] [compiler-rt] r172529 - /compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc
Dmitry Vyukov
dvyukov at google.com
Tue Jan 15 04:57:02 PST 2013
Author: dvyukov
Date: Tue Jan 15 06:57:02 2013
New Revision: 172529
URL: http://llvm.org/viewvc/llvm-project?rev=172529&view=rev
Log:
asan: fix standalone malloc implementation
Modified:
compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc?rev=172529&r1=172528&r2=172529&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc Tue Jan 15 06:57:02 2013
@@ -44,8 +44,8 @@
SecondaryAllocator> Allocator;
static Allocator allocator;
+static bool global_inited;
static THREADLOCAL AllocatorCache cache;
-static THREADLOCAL bool global_inited;
static THREADLOCAL bool thread_inited;
static pthread_key_t pkey;
@@ -147,3 +147,16 @@
void mallopt() {
}
} // extern "C"
+
+namespace std {
+ struct nothrow_t;
+}
+
+void *operator new(size_t size) ALIAS("malloc");
+void *operator new[](size_t size) ALIAS("malloc");
+void *operator new(size_t size, std::nothrow_t const&) ALIAS("malloc");
+void *operator new[](size_t size, std::nothrow_t const&) ALIAS("malloc");
+void operator delete(void *ptr) ALIAS("free");
+void operator delete[](void *ptr) ALIAS("free");
+void operator delete(void *ptr, std::nothrow_t const&) ALIAS("free");
+void operator delete[](void *ptr, std::nothrow_t const&) ALIAS("free");
More information about the llvm-commits
mailing list