-
Notifications
You must be signed in to change notification settings - Fork 22
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
remove unnecessary appending of null bytes in FlValue as length is known #42
base: master
Are you sure you want to change the base?
Conversation
Hi, thanks for the PR 💙 I was intrigued whether I left this without a proper check, but it seems like the PR would break the decoding with the following error:
Tested on Flutter 3.24.1 on Ubuntu 24.01.1 LTS 6.8.0-41-generic. You can run tests using |
@pr0gramista on my side this test successfully pass with this commit (Flutter 3.24.1, arch linux 6.10.6-arch1-1) The asserts are strange because on Dart-side, the argument
So I'm a bit clueless about why there is a divergence between our runs 😮 |
That is indeed interesting, maybe the time has come for my first Arch system. To help me narrow down the issue, could you tell me more about your system? Architecture and version of GTK would be helpful to compare. |
This does not seem related to GLib but more to how flutter itself convert the data to the native side. My architecture is x86_64. Here is a list of the libraries linked to example binary:
GTK is 3.24.43 and GLib is 2.80.5. I created a VM running Ubuntu 24.04.1 LTS ( Does the test passes on your system for the master branch ? |
Hi,
This PR removes a useless copy of the input string when decoding in Linux because the glib function (
g_convert_with_iconv
) actually does not expect a C-string but an array of gchar with the actual length (length may be set to-1
for null-terminated string).When obtaining the string on the C side:
charlen
will effectively encode the string length sotoUse
does not require to end with a null byte :)