blob: 283cb57190f48ce26fd6a96aed45ca7f0d86e5cd [file] [log] [blame]
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
library FfiTestCoordinateBare;
import 'dart:ffi' as ffi;
/// Large sample struct for dart:ffi library.
class VeryLargeStruct extends ffi.Pointer<ffi.Void> {
int a;
int b;
int c;
int d;
int e;
int f;
int g;
int h;
int i;
double j;
double k;
VeryLargeStruct parent;
int numChidlren;
VeryLargeStruct children;
int smallLastField;
// generated by @ffi.struct annotation
external static int sizeOf();
VeryLargeStruct offsetBy(int offsetInBytes) =>
VeryLargeStruct elementAt(int index) => offsetBy(sizeOf() * index);
static VeryLargeStruct allocate({int count: 1}) =>
ffi.allocate<ffi.Uint8>(count: count * sizeOf()).cast();