@@ -96,7 +96,7 @@ should be able to:
9696 - rely on finalization callbacks to be invoked even if an isolate group is
9797 shutting down.
9898
99- The first requirements is self-explanatory: we would like to avoid departures
99+ The second requirement is self-explanatory: we would like to avoid departures
100100from run-to-completion model that Dart currently provides for synchronous code.
101101
102102To explain the problem of premature finalization, consider the following code:
@@ -180,7 +180,7 @@ abstract class Finalizer<T> {
180180 /// Attaches this finalizer to the given [value].
181181 ///
182182 /// When [value] is no longer accessible to the program,
183- /// the registry *may* call its callback function with [finalizationToken ]
183+ /// the registry *may* call its callback function with [token ]
184184 /// as argument.
185185 ///
186186 /// The [value] and [detachKey] arguments do not count towards those
@@ -268,7 +268,7 @@ typedef NativeFinalizerPtr = Pointer<NativeFunction<NativeFinalizer>>
268268/// attached finalizers are definitely called at least once before the program
269269/// ends, and the callbacks are called as soon as possible after an object
270270/// is recognized as inaccessible.
271- abstract class NativeFinalizer<T> {
271+ abstract class NativeFinalizer {
272272 /// Creates a finalizer with the given finalization callback.
273273 ///
274274 /// Note: the [callback] is expected to be a native function which can be
@@ -284,7 +284,7 @@ abstract class NativeFinalizer<T> {
284284 /// Attaches this finalizer to the given [value].
285285 ///
286286 /// When [value] is no longer accessible to the program,
287- /// the registry will call its callback function with [finalizationToken ]
287+ /// the registry will call its callback function with [token ]
288288 /// as argument.
289289 ///
290290 /// The [value] and [detachKey] arguments do not count towards those
@@ -301,7 +301,7 @@ abstract class NativeFinalizer<T> {
301301 /// [externalSize] is an amount of native (non-Dart) memory owned by the
302302 /// given [value]. This information is used to drive garbage collection
303303 /// scheduling heuristics.
304- void attach(Object value, T token, {Object? detachKey, int externalSize}});
304+ void attach(Finalizable value, Pointer<Void> token, {Object? detachKey, int externalSize}});
305305
306306 /// Detaches the finalizer from any objects that used [detachKey] when
307307 /// attaching the finalizer to them.
0 commit comments