[vm/ffi] Document API handle scopes on Handle

Bug: https://github.com/dart-lang/sdk/issues/54263
CoreLibraryReviewExempt: Doc updated of VM-only feature.
Change-Id: Ie9c643ca6028b86239099932112a88ff59d123df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/341461
Reviewed-by: Martin Kustermann <kustermann@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
This commit is contained in:
Daco Harkes 2023-12-14 10:16:30 +00:00 committed by Commit Queue
parent 55bd60be32
commit 593a3d3c2c

View file

@ -131,10 +131,15 @@ final class Bool extends NativeType {
@unsized
abstract final class Void extends NativeType {}
/// Represents `Dart_Handle` in C.
/// Represents `Dart_Handle` from `dart_api.h` in C.
///
/// [Handle] is not constructible in the Dart code and serves purely as marker in
/// type signatures.
/// [Handle] is not constructible in the Dart code and serves purely as marker
/// in type signatures.
///
/// If [Handle] is part of the native signature of a [Native] external function
/// or [NativeFunctionPointer.asFunction], an API handle scope is created for
/// the duration of the FFI call. For more information on API scopes, refer to
/// the documentation on `Dart_EnterScope` in `dart_api.h`.
@Since('2.9')
abstract final class Handle extends NativeType {}