-
As I understand destructors in C# are just syntactic sugar for Does GC use reflection to check whether |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
You can access a bitflag from object's pMethodTable to see if it has a finalizer or not ( |
Beta Was this translation helpful? Give feedback.
You can access a bitflag from object's pMethodTable to see if it has a finalizer or not (
obj->pMT->m_flags & 0x00100000
). But I think GC doesn't query it explicitly. Instead, we register object in the finalizer queue on the allocation step. Objects with finalizers always use the slow path for allocations.