Fix compilation of server.cc on hpux.
[official-gcc.git] / libsanitizer / tsan / tsan_stack_trace.h
blob3eb8ce156e8358279de57fd6509cfd948e1c547e
1 //===-- tsan_stack_trace.h --------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file is a part of ThreadSanitizer (TSan), a race detector.
11 //===----------------------------------------------------------------------===//
12 #ifndef TSAN_STACK_TRACE_H
13 #define TSAN_STACK_TRACE_H
15 #include "sanitizer_common/sanitizer_stacktrace.h"
16 #include "tsan_defs.h"
18 namespace __tsan {
20 // StackTrace which calls malloc/free to allocate the buffer for
21 // addresses in stack traces.
22 struct VarSizeStackTrace : public StackTrace {
23 uptr *trace_buffer; // Owned.
25 VarSizeStackTrace();
26 ~VarSizeStackTrace();
27 void Init(const uptr *pcs, uptr cnt, uptr extra_top_pc = 0);
29 // Reverses the current stack trace order, the top frame goes to the bottom,
30 // the last frame goes to the top.
31 void ReverseOrder();
33 private:
34 void ResizeBuffer(uptr new_size);
36 VarSizeStackTrace(const VarSizeStackTrace &);
37 void operator=(const VarSizeStackTrace &);
40 } // namespace __tsan
42 #endif // TSAN_STACK_TRACE_H