2021-02-09 13:47:12 +08:00
|
|
|
//===-- msan_chained_origin_depot.h -----------------------------*- C++ -*-===//
|
2014-05-21 17:02:13 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2014-05-21 17:02:13 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2021-02-09 13:47:12 +08:00
|
|
|
// This file is a part of MemorySanitizer.
|
|
|
|
//
|
2014-05-21 17:02:13 +08:00
|
|
|
// A storage for chained origins.
|
|
|
|
//===----------------------------------------------------------------------===//
|
2021-02-09 13:47:12 +08:00
|
|
|
|
2014-05-21 17:02:13 +08:00
|
|
|
#ifndef MSAN_CHAINED_ORIGIN_DEPOT_H
|
|
|
|
#define MSAN_CHAINED_ORIGIN_DEPOT_H
|
|
|
|
|
|
|
|
#include "sanitizer_common/sanitizer_common.h"
|
|
|
|
|
|
|
|
namespace __msan {
|
|
|
|
|
2021-02-09 13:47:12 +08:00
|
|
|
// Gets the statistic of the origin chain storage.
|
2021-09-29 02:20:18 +08:00
|
|
|
StackDepotStats ChainedOriginDepotGetStats();
|
2021-02-09 13:47:12 +08:00
|
|
|
|
|
|
|
// Stores a chain with StackDepot ID here_id and previous chain ID prev_id.
|
|
|
|
// If successful, returns true and the new chain id new_id.
|
|
|
|
// If the same element already exists, returns false and sets new_id to the
|
|
|
|
// existing ID.
|
2014-05-21 17:02:13 +08:00
|
|
|
bool ChainedOriginDepotPut(u32 here_id, u32 prev_id, u32 *new_id);
|
2021-02-09 13:47:12 +08:00
|
|
|
|
|
|
|
// Retrieves the stored StackDepot ID for the given origin ID.
|
2014-05-21 17:02:13 +08:00
|
|
|
u32 ChainedOriginDepotGet(u32 id, u32 *other);
|
|
|
|
|
2014-09-04 18:36:14 +08:00
|
|
|
void ChainedOriginDepotLockAll();
|
|
|
|
void ChainedOriginDepotUnlockAll();
|
|
|
|
|
2014-05-21 17:02:13 +08:00
|
|
|
} // namespace __msan
|
|
|
|
|
|
|
|
#endif // MSAN_CHAINED_ORIGIN_DEPOT_H
|