asan: fix standalone malloc implementation

llvm-svn: 172529
This commit is contained in:
Dmitry Vyukov 2013-01-15 12:57:02 +00:00
parent 00911f1d55
commit 9ab63f68fc
1 changed files with 14 additions and 1 deletions

View File

@ -44,8 +44,8 @@ typedef CombinedAllocator<PrimaryAllocator, AllocatorCache,
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 mallinfo() {
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");