1 //===-- asan_stack.cc -----------------------------------------------------===//
3 // This file is distributed under the University of Illinois Open Source
4 // License. See LICENSE.TXT for details.
6 //===----------------------------------------------------------------------===//
8 // This file is a part of AddressSanitizer, an address sanity checker.
10 // Code for ASan stack trace.
11 //===----------------------------------------------------------------------===//
12 #include "asan_internal.h"
13 #include "asan_stack.h"
14 #include "sanitizer_common/sanitizer_atomic.h"
18 static atomic_uint32_t malloc_context_size
;
20 void SetMallocContextSize(u32 size
) {
21 atomic_store(&malloc_context_size
, size
, memory_order_release
);
24 u32
GetMallocContextSize() {
25 return atomic_load(&malloc_context_size
, memory_order_acquire
);
30 // ------------------ Interface -------------- {{{1
33 SANITIZER_INTERFACE_ATTRIBUTE
34 void __sanitizer_print_stack_trace() {
35 using namespace __asan
;
36 PRINT_CURRENT_STACK();