diff options
author | Kostya Serebryany <kcc@google.com> | 2016-04-20 23:28:06 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2016-04-20 23:28:06 +0000 |
commit | e63db09bea471b5a37b4ef4c0aea85c0457dd0cd (patch) | |
tree | c225cf8fb910ab3c04e6cd59be7c9ef471f27da8 /compiler-rt | |
parent | d4eaa74693c47788aac71c13298a7a8d7f07ab6e (diff) | |
download | bcm5719-llvm-e63db09bea471b5a37b4ef4c0aea85c0457dd0cd.tar.gz bcm5719-llvm-e63db09bea471b5a37b4ef4c0aea85c0457dd0cd.zip |
[sanitizer] update the sanitizer_allocator_testlib
llvm-svn: 266934
Diffstat (limited to 'compiler-rt')
-rw-r--r-- | compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc b/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc index 0cc3b9ba694..1a4c5501a92 100644 --- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc +++ b/compiler-rt/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 |