5#ifndef INCLUDE_CPPGC_PREFINALIZER_H_
6#define INCLUDE_CPPGC_PREFINALIZER_H_
21 void*
operator new(size_t,
void* location) =
delete;
22 void*
operator new(size_t) =
delete;
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; \
64 self->PreFinalizer(); \
69 CPPGC_NO_UNIQUE_ADDRESS cppgc::internal::PrefinalizerRegistration \
70 prefinalizer_dummy_{this, Class::InvokePreFinalizer}; \
71 static_assert(true, "Force semicolon.")
bool(*)(const cppgc::LivenessBroker &, void *) Callback
PrefinalizerRegistration(void *, Callback)