-
Notifications
You must be signed in to change notification settings - Fork 1.7k
dart:ffi Strings #35762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In our tests (and a simplistic SQLite wrapper) we use https://github.com/dart-lang/sdk/blob/master/tests/standalone_2/ffi/cstring.dart It's so simple it should probably not be part of the sdk. However, we might need something more performant (which avoids copying), if this is not performant enough. |
There's an initial version of this now in https://github.com/dart-lang/ffi We should see if we can make memory management easier. It would be very beneficial if you could pass string constants to C functions and now have to worry about free'ing them. |
Great! Thanks @sjindel-google and @mit-mit! Should we migrate our examples and tests to depend on |
Yes, I think we should. Examples that are apps generally protect themselves using dependency pinning (i.e. checking in the .lock file): https://dart.dev/guides/libraries/private-files#pubspeclock |
We've got support for strings in |
Add library functions to convert Dart strings to C strings and vice versa.
The text was updated successfully, but these errors were encountered: