@@ -96,7 +96,7 @@ should be able to:
96
96
- rely on finalization callbacks to be invoked even if an isolate group is
97
97
shutting down.
98
98
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
100
100
from run-to-completion model that Dart currently provides for synchronous code.
101
101
102
102
To explain the problem of premature finalization, consider the following code:
@@ -180,7 +180,7 @@ abstract class Finalizer<T> {
180
180
/// Attaches this finalizer to the given [value].
181
181
///
182
182
/// 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 ]
184
184
/// as argument.
185
185
///
186
186
/// The [value] and [detachKey] arguments do not count towards those
@@ -268,7 +268,7 @@ typedef NativeFinalizerPtr = Pointer<NativeFunction<NativeFinalizer>>
268
268
/// attached finalizers are definitely called at least once before the program
269
269
/// ends, and the callbacks are called as soon as possible after an object
270
270
/// is recognized as inaccessible.
271
- abstract class NativeFinalizer<T> {
271
+ abstract class NativeFinalizer {
272
272
/// Creates a finalizer with the given finalization callback.
273
273
///
274
274
/// Note: the [callback] is expected to be a native function which can be
@@ -284,7 +284,7 @@ abstract class NativeFinalizer<T> {
284
284
/// Attaches this finalizer to the given [value].
285
285
///
286
286
/// 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 ]
288
288
/// as argument.
289
289
///
290
290
/// The [value] and [detachKey] arguments do not count towards those
@@ -301,7 +301,7 @@ abstract class NativeFinalizer<T> {
301
301
/// [externalSize] is an amount of native (non-Dart) memory owned by the
302
302
/// given [value]. This information is used to drive garbage collection
303
303
/// 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}});
305
305
306
306
/// Detaches the finalizer from any objects that used [detachKey] when
307
307
/// attaching the finalizer to them.
0 commit comments