v8  8.6.395 (node 15.0.1)
V8 is Google's open source JavaScript engine
prefinalizer-handler.h
Go to the documentation of this file.
1 // Copyright 2020 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef INCLUDE_CPPGC_INTERNAL_PREFINALIZER_HANDLER_H_
6 #define INCLUDE_CPPGC_INTERNAL_PREFINALIZER_HANDLER_H_
7 
8 #include "cppgc/heap.h"
9 #include "cppgc/liveness-broker.h"
10 
11 namespace cppgc {
12 namespace internal {
13 
14 class V8_EXPORT PreFinalizerRegistrationDispatcher final {
15  public:
16  using PreFinalizerCallback = bool (*)(const LivenessBroker&, void*);
17  struct PreFinalizer {
18  void* object;
19  PreFinalizerCallback callback;
20 
21  bool operator==(const PreFinalizer& other);
22  };
23 
24  static void RegisterPrefinalizer(PreFinalizer pre_finalizer);
25 };
26 
27 } // namespace internal
28 } // namespace cppgc
29 
30 #endif // INCLUDE_CPPGC_INTERNAL_PREFINALIZER_HANDLER_H_