@@ -252,6 +252,8 @@ class FfiTransformer extends Transformer {
252252 final Procedure addressGetter;
253253 final Procedure structPointerGetRef;
254254 final Procedure structPointerSetRef;
255+ final Procedure structPointerRefWithFinalizer;
256+ final Procedure structPointerRefWithFinalizerTearoff;
255257 final Procedure structPointerGetElemAt;
256258 final Procedure structPointerSetElemAt;
257259 final Procedure structPointerElementAt;
@@ -260,12 +262,15 @@ class FfiTransformer extends Transformer {
260262 final Procedure structPointerElementAtTearoff;
261263 final Procedure unionPointerGetRef;
262264 final Procedure unionPointerSetRef;
265+ final Procedure unionPointerRefWithFinalizer;
266+ final Procedure unionPointerRefWithFinalizerTearoff;
263267 final Procedure unionPointerGetElemAt;
264268 final Procedure unionPointerSetElemAt;
265269 final Procedure unionPointerElementAt;
266270 final Procedure unionPointerPlusOperator;
267271 final Procedure unionPointerMinusOperator;
268272 final Procedure unionPointerElementAtTearoff;
273+ final Procedure uint8PointerAsTypedList;
269274 final Procedure structArrayElemAt;
270275 final Procedure unionArrayElemAt;
271276 final Procedure arrayArrayElemAt;
@@ -355,6 +360,7 @@ class FfiTransformer extends Transformer {
355360 late final InterfaceType nativeTypeType;
356361 // The Pointer type when instantiated to bounds.
357362 late final InterfaceType pointerNativeTypeType;
363+ late final InterfaceType uint8Type;
358364 late final InterfaceType compoundType;
359365
360366 /// Classes corresponding to [NativeType] , indexed by [NativeType] .
@@ -494,6 +500,10 @@ class FfiTransformer extends Transformer {
494500 index.getProcedure ('dart:ffi' , 'StructPointer' , 'get:ref' ),
495501 structPointerSetRef =
496502 index.getProcedure ('dart:ffi' , 'StructPointer' , 'set:ref' ),
503+ structPointerRefWithFinalizer =
504+ index.getProcedure ('dart:ffi' , 'StructPointer' , 'refWithFinalizer' ),
505+ structPointerRefWithFinalizerTearoff = index.getProcedure ('dart:ffi' ,
506+ 'StructPointer' , LibraryIndex .tearoffPrefix + 'refWithFinalizer' ),
497507 structPointerGetElemAt =
498508 index.getProcedure ('dart:ffi' , 'StructPointer' , '[]' ),
499509 structPointerSetElemAt =
@@ -510,6 +520,10 @@ class FfiTransformer extends Transformer {
510520 index.getProcedure ('dart:ffi' , 'UnionPointer' , 'get:ref' ),
511521 unionPointerSetRef =
512522 index.getProcedure ('dart:ffi' , 'UnionPointer' , 'set:ref' ),
523+ unionPointerRefWithFinalizer =
524+ index.getProcedure ('dart:ffi' , 'UnionPointer' , 'refWithFinalizer' ),
525+ unionPointerRefWithFinalizerTearoff = index.getProcedure ('dart:ffi' ,
526+ 'UnionPointer' , LibraryIndex .tearoffPrefix + 'refWithFinalizer' ),
513527 unionPointerGetElemAt =
514528 index.getProcedure ('dart:ffi' , 'UnionPointer' , '[]' ),
515529 unionPointerSetElemAt =
@@ -522,6 +536,8 @@ class FfiTransformer extends Transformer {
522536 index.getProcedure ('dart:ffi' , 'UnionPointer' , '-' ),
523537 unionPointerElementAtTearoff = index.getProcedure ('dart:ffi' ,
524538 'UnionPointer' , LibraryIndex .tearoffPrefix + 'elementAt' ),
539+ uint8PointerAsTypedList =
540+ index.getProcedure ('dart:ffi' , 'Uint8Pointer' , 'asTypedList' ),
525541 structArrayElemAt = index.getProcedure ('dart:ffi' , 'StructArray' , '[]' ),
526542 unionArrayElemAt = index.getProcedure ('dart:ffi' , 'UnionArray' , '[]' ),
527543 arrayArrayElemAt = index.getProcedure ('dart:ffi' , 'ArrayArray' , '[]' ),
@@ -676,6 +692,8 @@ class FfiTransformer extends Transformer {
676692 intptrNativeTypeCfe =
677693 NativeTypeCfe (this , InterfaceType (intptrClass, Nullability .nonNullable))
678694 as AbiSpecificNativeTypeCfe ;
695+ uint8Type = InterfaceType (
696+ nativeTypesClasses[NativeType .kUint8]! , Nullability .nonNullable);
679697 compoundType = InterfaceType (
680698 compoundClass,
681699 Nullability .nonNullable,
0 commit comments