Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Support for Inline Array in Struct #206

Merged
merged 4 commits into from
Apr 19, 2021

Conversation

mannprerak2
Copy link
Contributor

@mannprerak2 mannprerak2 commented Apr 16, 2021

Closes dart-lang/native#542

  • Added support for generating Inline Arrays in Struct.
  • Removed array-workaround config key. (Using this will emit a warning -> unknown key in config).
  • Updated test, changelog, readme, and version.

Copy link
Contributor

@dcharkes dcharkes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet! I love how many lines of code we delete here (both generated and non generated)!

final struct1 = bindings.getStruct1();
var expectedValue = 1;
for (var i = 0; i < struct1.ref.data.dimensions[0]; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah the old api gave access to .dimensions? Then this is kind of a breaking change.

But we should likely add that kind of access to Array in dart:ffi as well.

Copy link
Contributor Author

@mannprerak2 mannprerak2 Apr 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then this is kind of a breaking change

Should I update the version to 3.0.0-beta.1 then?

But we should likely add that kind of access to Array in dart:ffi as well.

Yeah, I was wondering that there's no way to get the length of an array. (even though its constant and the user would know it beforehand)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, if we want to be true to semantic versioning, we probably should make it 3.0.0-beta.0, good catch!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the key is probably rejected in the config right now, instead of just deprecated. So that is also a breaking change.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the key is probably rejected

It will simply warn about an unknown key called array-workaound, the tool would still work since an unknown key is not a severe error.


Updated version.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also removed the previously deprecated llvm-lib config.

CHANGELOG.md Outdated Show resolved Hide resolved
@dcharkes dcharkes merged commit e0718ba into dart-archive:master Apr 19, 2021
@mannprerak2 mannprerak2 deleted the array_support branch April 19, 2021 08:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Support for inline arrays in structs
2 participants