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 | 075c251640c88f5431dd291e86f1ca2b9c266ce4 (patch) | |
tree | 46fa59dcb31996dc3a38b1ccb562b0e9b2048f9c /lib | |
parent | f021a7a011573764e31bbe00f9283e5b09b74362 (diff) |
[sanitizer] update the sanitizer_allocator_testlib
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@266934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sanitizer_common/tests/sanitizer_allocator_testlib.cc | 9 |
1 files changed, 5 insertions, 4 deletions
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 |