1 //===-- bytemap.h -----------------------------------------------*- C++ -*-===//
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 #ifndef SCUDO_BYTEMAP_H_
10 #define SCUDO_BYTEMAP_H_
12 #include "atomic_helpers.h"
18 template <uptr Size> class FlatByteMap {
20 void initLinkerInitialized() {}
21 void init() { memset(Map, 0, sizeof(Map)); }
23 void unmapTestOnly() {}
25 void set(uptr Index, u8 Value) {
26 DCHECK_LT(Index, Size);
27 DCHECK_EQ(0U, Map[Index]);
30 u8 operator[](uptr Index) {
31 DCHECK_LT(Index, Size);
44 #endif // SCUDO_BYTEMAP_H_