1 //===-- tsan_ignoreset.cc -------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // This file is a part of ThreadSanitizer (TSan), a race detector.
11 //===----------------------------------------------------------------------===//
12 #include "tsan_ignoreset.h"
16 const uptr IgnoreSet::kMaxSize;
18 IgnoreSet::IgnoreSet()
22 void IgnoreSet::Add(u32 stack_id) {
23 if (size_ == kMaxSize)
25 for (uptr i = 0; i < size_; i++) {
26 if (stacks_[i] == stack_id)
29 stacks_[size_++] = stack_id;
32 void IgnoreSet::Reset() {
36 uptr IgnoreSet::Size() const {
40 u32 IgnoreSet::At(uptr i) const {
42 CHECK_LE(size_, kMaxSize);