1 //===-- tsan_ignoreset.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 ThreadSanitizer (TSan), a race detector.
12 //===----------------------------------------------------------------------===//
13 #include "tsan_ignoreset.h"
17 const uptr IgnoreSet::kMaxSize;
19 IgnoreSet::IgnoreSet()
23 void IgnoreSet::Add(u32 stack_id) {
24 if (size_ == kMaxSize)
26 for (uptr i = 0; i < size_; i++) {
27 if (stacks_[i] == stack_id)
30 stacks_[size_++] = stack_id;
33 void IgnoreSet::Reset() {
37 uptr IgnoreSet::Size() const {
41 u32 IgnoreSet::At(uptr i) const {
43 CHECK_LE(size_, kMaxSize);