tsan_ignoreset.h 1004 B

123456789101112131415161718192021222324252627282930313233343536
  1. //===-- tsan_ignoreset.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.
  10. //
  11. // IgnoreSet holds a set of stack traces where ignores were enabled.
  12. //===----------------------------------------------------------------------===//
  13. #ifndef TSAN_IGNORESET_H
  14. #define TSAN_IGNORESET_H
  15. #include "tsan_defs.h"
  16. namespace __tsan {
  17. class IgnoreSet {
  18. public:
  19. IgnoreSet();
  20. void Add(StackID stack_id);
  21. void Reset() { size_ = 0; }
  22. uptr Size() const { return size_; }
  23. StackID At(uptr i) const;
  24. private:
  25. static constexpr uptr kMaxSize = 16;
  26. uptr size_;
  27. StackID stacks_[kMaxSize];
  28. };
  29. } // namespace __tsan
  30. #endif // TSAN_IGNORESET_H