1 //===-- tsan_ignoreset.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 ThreadSanitizer (TSan), a race detector.
10 //===----------------------------------------------------------------------===//
11 #include "tsan_ignoreset.h"
15 const uptr
IgnoreSet::kMaxSize
;
17 IgnoreSet::IgnoreSet()
21 void IgnoreSet::Add(u32 stack_id
) {
22 if (size_
== kMaxSize
)
24 for (uptr i
= 0; i
< size_
; i
++) {
25 if (stacks_
[i
] == stack_id
)
28 stacks_
[size_
++] = stack_id
;
31 void IgnoreSet::Reset() {
35 uptr
IgnoreSet::Size() const {
39 u32
IgnoreSet::At(uptr i
) const {
41 CHECK_LE(size_
, kMaxSize
);