Skip to content

[vm/ffi] Change load() and store() to val and ref getter/setter pairs. #37361

Closed
@sjindel-google

Description

@sjindel-google

In the new structs API (#37229) we will remove load() and store() in favor of a val getter/setter pair for non-struct pointers and a ref getter for pointers to structs:

@pragma("vm:entry-point")
class Pointer<T extends NativeType> extends NativeType {
  const Pointer();

  external factory Pointer.allocate({int count: 1});

  external factory Pointer.fromAddress(int ptr);

  external set val(@DartRepresentationOf("T") Object value);

  external dynamic get val;

  external T get ref;

  external int get address;

  external Pointer<U> cast<U extends NativeType>();
}

This task includes implementation of the decisions make in #35782 and #35756.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.library-ffi

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions