1 //===-- sanitizer_stoptheworld_fuchsia.cpp -------------------------------===//
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 // See sanitizer_stoptheworld.h for details.
11 //===---------------------------------------------------------------------===//
13 #include "sanitizer_platform.h"
17 #include <zircon/sanitizer.h>
19 #include "sanitizer_stoptheworld.h"
21 namespace __sanitizer
{
23 // The Fuchsia implementation stops the world but doesn't offer a real
24 // SuspendedThreadsList argument. This is enough for ASan's use case,
25 // and LSan does not use this API on Fuchsia.
26 void StopTheWorld(StopTheWorldCallback callback
, void *argument
) {
28 StopTheWorldCallback callback
;
30 } params
= {callback
, argument
};
31 __sanitizer_memory_snapshot(
32 nullptr, nullptr, nullptr, nullptr,
33 [](zx_status_t
, void *data
) {
34 auto params
= reinterpret_cast<Params
*>(data
);
35 params
->callback({}, params
->argument
);
40 } // namespace __sanitizer
42 #endif // SANITIZER_FUCHSIA