msan_chained_origin_depot.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //===-- msan_chained_origin_depot.h -----------------------------*- C++ -*-===//
  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. #ifndef MSAN_CHAINED_ORIGIN_DEPOT_H
  14. #define MSAN_CHAINED_ORIGIN_DEPOT_H
  15. #include "sanitizer_common/sanitizer_common.h"
  16. namespace __msan {
  17. // Gets the statistic of the origin chain storage.
  18. StackDepotStats ChainedOriginDepotGetStats();
  19. // Stores a chain with StackDepot ID here_id and previous chain ID prev_id.
  20. // If successful, returns true and the new chain id new_id.
  21. // If the same element already exists, returns false and sets new_id to the
  22. // existing ID.
  23. bool ChainedOriginDepotPut(u32 here_id, u32 prev_id, u32 *new_id);
  24. // Retrieves the stored StackDepot ID for the given origin ID.
  25. u32 ChainedOriginDepotGet(u32 id, u32 *other);
  26. void ChainedOriginDepotBeforeFork();
  27. void ChainedOriginDepotAfterFork(bool fork_child);
  28. } // namespace __msan
  29. #endif // MSAN_CHAINED_ORIGIN_DEPOT_H