File tree Expand file tree Collapse file tree 4 files changed +29
-10
lines changed
pkgs/native_synchronization Expand file tree Collapse file tree 4 files changed +29
-10
lines changed Original file line number Diff line number Diff line change @@ -14,15 +14,19 @@ permissions: read-all
14
14
15
15
jobs :
16
16
analyze :
17
- runs-on : ubuntu-latest
17
+ runs-on : ${{ matrix.os }}
18
+ strategy :
19
+ matrix :
20
+ os : [ubuntu-latest]
21
+ sdk : [dev, stable]
18
22
19
23
steps :
20
24
# These are the latest versions of the github actions; dependabot will
21
25
# send PRs to keep these up-to-date.
22
26
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
23
27
- uses : dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
24
28
with :
25
- sdk : dev
29
+ sdk : ${{ matrix.sdk }}
26
30
27
31
- name : Install dependencies
28
32
run : dart pub get
39
43
strategy :
40
44
matrix :
41
45
os : [ubuntu-latest, macos-latest, windows-latest]
42
- sdk : [dev]
46
+ sdk : [dev, stable ]
43
47
steps :
44
48
- uses : actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
45
49
- uses : dart-lang/setup-dart@d6a63dab3335f427404425de0fbfed4686d93c4f
Original file line number Diff line number Diff line change
1
+ ## 0.2.0
2
+
3
+ - Lower SDK lower bound to 3.0.0.
4
+
1
5
## 0.1.0
2
6
3
7
- Initial version.
Original file line number Diff line number Diff line change @@ -103,11 +103,22 @@ class Mailbox {
103
103
static final _emptyResponse = Uint8List (0 );
104
104
105
105
static Uint8List _toList (Pointer <Uint8 > buffer, int length) {
106
- return length == 0
107
- ? _emptyResponse
108
- // We have to ignore sdk_version_since warning due to dartbug.com/53142.
109
- // ignore: sdk_version_since
110
- : buffer.asTypedList (length, finalizer: malloc.nativeFree);
106
+ if (length == 0 ) {
107
+ return _emptyResponse;
108
+ }
109
+
110
+ // TODO: remove feature detection once 3.1 becomes stable.
111
+ // ignore: omit_local_variable_types
112
+ final Uint8List Function (int ) asTypedList = buffer.asTypedList;
113
+ if (asTypedList is Uint8List Function (int ,
114
+ {Pointer <NativeFinalizerFunction > finalizer})) {
115
+ return asTypedList (length, finalizer: malloc.nativeFree);
116
+ }
117
+
118
+ final result = Uint8List (length);
119
+ result.setRange (0 , length, buffer.asTypedList (length));
120
+ malloc.free (buffer);
121
+ return result;
111
122
}
112
123
113
124
static Pointer <Uint8 > _toBuffer (Uint8List list) {
Original file line number Diff line number Diff line change 1
1
name : native_synchronization
2
2
description : Low level synchronization primitives built on dart:ffi.
3
- version : 0.1 .0
3
+ version : 0.2 .0
4
4
repository : https://github.com/dart-lang/native_synchronization
5
5
6
6
environment :
7
- sdk : " >=3.1.0-348.0.dev <4.0.0"
7
+ sdk : " >=3.0.0 <4.0.0"
8
8
9
9
dependencies :
10
10
ffi : ^2.1.0
You can’t perform that action at this time.
0 commit comments