Skip to content

Commit 2c1d405

Browse files
dcharkescommit-bot@chromium.org
authored andcommitted
[changelog/ffi] Document dart:ffi changes for D26
Change-Id: I371a9b9bac29bc75bc5b69f960da56854f515680 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/122149 Commit-Queue: Daco Harkes <dacoharkes@google.com> Reviewed-by: Martin Kustermann <kustermann@google.com>
1 parent 9220890 commit 2c1d405

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

CHANGELOG.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,26 @@ main() { foo(() {}); }
8080
* Added optional `parent` parameter to `TimelineTask` constructor to allow for
8181
linking of asynchronous timeline events in the DevTools timeline view.
8282

83+
### `dart:ffi`
84+
85+
* **Breaking change**: The API now makes use of static extension members.
86+
Static extension members enable the `dart:ffi` API to be more precise with
87+
types, and provide convenient access to memory through extension getters and
88+
setters. The extension members on `Pointer` provide `.value` and `.value =`
89+
for accessing the value in native memory and `[]` and `[]=` for indexed access.
90+
The method `asExternalTypedData` has been replaced with `asTypedList` extension
91+
methods. And finally, `Structs` do no longer have a type argument and are
92+
accessed the extension member `.ref` on `Pointer`.
93+
These changes makes the code using `dart:ffi` much more concise.
94+
* **Breaking change**: The memory management has been removed (`Pointer.allocate`
95+
and `Pointer.free`). Instead, memory management is available in
96+
[package:ffi](https://pub.dev/packages/ffi).
97+
* **Breaking change**: `Pointer.offsetBy` was removed, use `cast` and `elementAt`
98+
instead.
99+
* Faster memory load and stores.
100+
* The dartanalyzer (commandline and IDEs) now reports `dart:ffi` static errors.
101+
* Callbacks are now supported in AOT (ahead-of-time).
102+
83103
### Dart VM
84104

85105
* Added a new tool for AOT compiling Dart programs to native, self-contained

0 commit comments

Comments
 (0)