1 //===-- msan_chained_origin_depot.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 // This file is a part of MemorySanitizer.
11 // A storage for chained origins.
12 //===----------------------------------------------------------------------===//
14 #ifndef MSAN_CHAINED_ORIGIN_DEPOT_H
15 #define MSAN_CHAINED_ORIGIN_DEPOT_H
17 #include "sanitizer_common/sanitizer_common.h"
21 // Gets the statistic of the origin chain storage.
22 StackDepotStats
ChainedOriginDepotGetStats();
24 // Stores a chain with StackDepot ID here_id and previous chain ID prev_id.
25 // If successful, returns true and the new chain id new_id.
26 // If the same element already exists, returns false and sets new_id to the
28 bool ChainedOriginDepotPut(u32 here_id
, u32 prev_id
, u32
*new_id
);
30 // Retrieves the stored StackDepot ID for the given origin ID.
31 u32
ChainedOriginDepotGet(u32 id
, u32
*other
);
33 void ChainedOriginDepotBeforeFork();
34 void ChainedOriginDepotAfterFork(bool fork_child
);
38 #endif // MSAN_CHAINED_ORIGIN_DEPOT_H