Skip to content
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

allow VLA serialization with t=254 #28

Closed
wants to merge 2 commits into from
Closed

Conversation

sonoro1234
Copy link

This solves issue #27

@sonoro1234
Copy link
Author

I can add your proposed pcall solution for issue #25 if you wish.

@adriweb
Copy link
Contributor

adriweb commented Apr 2, 2021 via email

@gvx
Copy link
Owner

gvx commented Apr 4, 2021

I would like to see if I can fold VLAs and VLSs into type code 252 first.

@adriweb Yes, in my head I'd already reserved type code 255 for some kind of "extended type" thing. I'm not sure what the semantics of it are going to be yet.

@sonoro1234
Copy link
Author

So, what is going to be done'

@sonoro1234
Copy link
Author

Another way to distinguish VLA and VLS is that ffi.sizeof(ty,0)~=ffi.sizeof(ty,1)

@gvx
Copy link
Owner

gvx commented Dec 28, 2024

Apologies, I haven't looked at bitser for the past 3 1/2 year. Right now I can't promise anything, but I hope I can find the time to get reacquainted with bitser, luajit and your proposed fixes in January.

@sonoro1234
Copy link
Author

sonoro1234 commented Dec 28, 2024

meanwhile I have implemented another option in https://github.com/sonoro1234/anima/blob/master/anima/cdataser.lua
It uses ffi-reflect to recreate the table that would be used with ffi.new. That sould be combined with a more general serializer as Ser just to pluk the cdata.
The advantage would be that it is endianess safe which I am afraid it doesnt happen with binary serialization!!

@gvx
Copy link
Owner

gvx commented Dec 29, 2024

That is probably the way to go. I'm currently attempting to fix serialization of ctype and cdata values, which is difficult due to ffi.typeof sometimes returning the wrong ctype.

I'm tempted to declare all ctype/cdata/VLA/VLS values beyond the scope of bitser. In good news, I have an extension API ready to go, so I could write an extension for cdata stuff that depends on ffi-reflect.

The advantage would be that it is endianess safe which I am afraid it doesnt happen with binary serialization!!

Even without cdata etc, bitser is not endian-safe, I should probably add something about that in the README.

gvx added a commit that referenced this pull request Dec 29, 2024
@gvx
Copy link
Owner

gvx commented Dec 30, 2024

This PR is no longer applicable since c95cb0d.

@gvx gvx closed this Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants