A GC finalizer registry that invokes a callback when a watched object
is garbage-collected. Modeled after JavaScript's FinalizationRegistry.
The callback receives a held value (not the collected object itself), which is safe because the object may already be in an invalid state.
Not all targets support GC finalizers. On unsupported targets, the
constructor throws NotImplementedException.
Constructor
new(callback:T ‑> Void)
Creates a new GcFinalizer with the given cleanup callback.
The callback will be invoked with the held value when a registered
target object is garbage-collected.