5#ifndef INCLUDE_CPPGC_PREFINALIZER_H_
6#define INCLUDE_CPPGC_PREFINALIZER_H_
8#include "cppgc/internal/compiler-specific.h"
9#include "cppgc/liveness-broker.h"
17 using Callback =
bool (*)(
const cppgc::LivenessBroker&,
void*);
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56#define CPPGC_USING_PRE_FINALIZER(Class, PreFinalizer)
58 static bool InvokePreFinalizer(const cppgc::LivenessBroker& liveness_broker,
60 static_assert(cppgc::IsGarbageCollectedOrMixinTypeV<Class>,
61 "Only garbage collected objects can have prefinalizers");
62 Class* self = static_cast<Class*>(object);
63 if (liveness_broker.IsHeapObjectAlive(self)) return false;
70 prefinalizer_dummy_{this, Class::InvokePreFinalizer};
71 static_assert(true, "Force semicolon.")
void * operator new(size_t)=delete
void * operator new(size_t, void *location)=delete
PrefinalizerRegistration(void *, Callback)
#define CPPGC_NO_UNIQUE_ADDRESS