| Index: utils/archive/utils.dart
|
| diff --git a/utils/archive/utils.dart b/utils/archive/utils.dart
|
| index f85101b8860649a2ec6615dee09eae56fa0f2ffc..433cd9abba0547249def3437fd1336fdadcda4f2 100644
|
| --- a/utils/archive/utils.dart
|
| +++ b/utils/archive/utils.dart
|
| @@ -58,6 +58,32 @@ Uint8List bytesForC(List<int> input) {
|
| }
|
|
|
| /**
|
| + * Attaches [callback] as a finalizer for [object]. After [object] has been
|
| + * garbage collected, [callback] will be called and passed [peer] as an
|
| + * argument.
|
| + *
|
| + * Neither [callback] nor [peer] should contain any references to [object];
|
| + * otherwise, [object] will never be collected and [callback] will never be
|
| + * called.
|
| + */
|
| +void attachFinalizer(object, void callback(peer), [peer])
|
| + native "Archive_AttachFinalizer";
|
| +
|
| +/**
|
| + * A reference to a single value.
|
| + *
|
| + * This is primarily meant to be used when a finalizer needs to refer to a field
|
| + * on the object being finalized that may be set to null during the lifetime of
|
| + * the object. Since the object itself has been garbage collected once the
|
| + * finalizer runs, it needs a second-order reference to check if the field is
|
| + * null.
|
| + */
|
| +class Reference<E> {
|
| + E value;
|
| + Reference(this.value);
|
| +}
|
| +
|
| +/**
|
| * Returns a [Future] that completes immediately upon hitting the event loop.
|
| */
|
| Future async() {
|
|
|