msan_chained_origin_depot.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //===-- msan_chained_origin_depot.cpp -------------------------------------===//
  2. //
  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
  6. //
  7. //===----------------------------------------------------------------------===//
  8. //
  9. // This file is a part of MemorySanitizer.
  10. //
  11. // A storage for chained origins.
  12. //===----------------------------------------------------------------------===//
  13. #include "msan_chained_origin_depot.h"
  14. #include "sanitizer_common/sanitizer_chained_origin_depot.h"
  15. namespace __msan {
  16. static ChainedOriginDepot chainedOriginDepot;
  17. StackDepotStats ChainedOriginDepotGetStats() {
  18. return chainedOriginDepot.GetStats();
  19. }
  20. bool ChainedOriginDepotPut(u32 here_id, u32 prev_id, u32 *new_id) {
  21. return chainedOriginDepot.Put(here_id, prev_id, new_id);
  22. }
  23. u32 ChainedOriginDepotGet(u32 id, u32 *other) {
  24. return chainedOriginDepot.Get(id, other);
  25. }
  26. void ChainedOriginDepotLockAll() {
  27. chainedOriginDepot.LockAll();
  28. }
  29. void ChainedOriginDepotUnlockAll() {
  30. chainedOriginDepot.UnlockAll();
  31. }
  32. } // namespace __msan