From 075c251640c88f5431dd291e86f1ca2b9c266ce4 Mon Sep 17 00:00:00 2001 From: Kostya Serebryany Date: Wed, 20 Apr 2016 23:28:06 +0000 Subject: [sanitizer] update the sanitizer_allocator_testlib git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266934 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/sanitizer_common/tests') diff --git a/lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc b/lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc index 0cc3b9ba6..1a4c5501a 100644 --- a/lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc +++ b/lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc @@ -11,9 +11,10 @@ // for CombinedAllocator. //===----------------------------------------------------------------------===// /* Usage: -clang++ -fno-exceptions -g -fPIC -I. -I../include -Isanitizer \ +clang++ -std=c++11 -fno-exceptions -g -fPIC -I. -I../include -Isanitizer \ sanitizer_common/tests/sanitizer_allocator_testlib.cc \ - sanitizer_common/sanitizer_*.cc -shared -lpthread -o testmalloc.so + $(\ls sanitizer_common/sanitizer_*.cc | grep -v sanitizer_common_nolibc.cc) \ + -shared -lpthread -o testmalloc.so LD_PRELOAD=`pwd`/testmalloc.so /your/app */ #include "sanitizer_common/sanitizer_allocator.h" @@ -60,12 +61,12 @@ static void thread_dtor(void *v) { static void NOINLINE thread_init() { if (!global_inited) { global_inited = true; - allocator.Init(); + allocator.Init(false /*may_return_null*/); pthread_key_create(&pkey, thread_dtor); } thread_inited = true; pthread_setspecific(pkey, (void*)1); - cache.Init(); + cache.Init(nullptr); } } // namespace -- cgit v1.2.3