2021-02-09 13:47:12 +08:00
|
|
|
//===-- msan_chained_origin_depot.cpp -------------------------------------===//
|
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.
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "msan_chained_origin_depot.h"
|
|
|
|
|
2021-02-09 13:47:12 +08:00
|
|
|
#include "sanitizer_common/sanitizer_chained_origin_depot.h"
|
2014-05-21 17:02:13 +08:00
|
|
|
|
|
|
|
namespace __msan {
|
|
|
|
|
2021-02-09 13:47:12 +08:00
|
|
|
static ChainedOriginDepot chainedOriginDepot;
|
2014-05-21 17:02:13 +08:00
|
|
|
|
2021-09-29 02:20:18 +08:00
|
|
|
StackDepotStats ChainedOriginDepotGetStats() {
|
2014-05-21 17:02:13 +08:00
|
|
|
return chainedOriginDepot.GetStats();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool ChainedOriginDepotPut(u32 here_id, u32 prev_id, u32 *new_id) {
|
2021-02-09 13:47:12 +08:00
|
|
|
return chainedOriginDepot.Put(here_id, prev_id, new_id);
|
2014-05-21 17:02:13 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
u32 ChainedOriginDepotGet(u32 id, u32 *other) {
|
2021-02-09 13:47:12 +08:00
|
|
|
return chainedOriginDepot.Get(id, other);
|
2014-05-21 17:02:13 +08:00
|
|
|
}
|
|
|
|
|
2014-09-04 18:36:14 +08:00
|
|
|
void ChainedOriginDepotLockAll() {
|
|
|
|
chainedOriginDepot.LockAll();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ChainedOriginDepotUnlockAll() {
|
|
|
|
chainedOriginDepot.UnlockAll();
|
|
|
|
}
|
|
|
|
|
2015-10-01 08:22:21 +08:00
|
|
|
} // namespace __msan
|