1 //===-- asan_stack.cc -----------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file is a part of AddressSanitizer, an address sanity checker.
12 // Code for ASan stack trace.
13 //===----------------------------------------------------------------------===//
14 #include "asan_internal.h"
15 #include "asan_stack.h"
16 #include "sanitizer_common/sanitizer_atomic.h"
20 static atomic_uint32_t malloc_context_size;
22 void SetMallocContextSize(u32 size) {
23 atomic_store(&malloc_context_size, size, memory_order_release);
26 u32 GetMallocContextSize() {
27 return atomic_load(&malloc_context_size, memory_order_acquire);
32 // ------------------ Interface -------------- {{{1
35 SANITIZER_INTERFACE_ATTRIBUTE
36 void __sanitizer_print_stack_trace() {
37 using namespace __asan;
38 PRINT_CURRENT_STACK();