-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[vm/ffi] Allow struct classes to override sizeOf #37842
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
This would not allow people to access those fields right? Only to |
You could write the fields by hand, or delegate them to different (generated) implementations depending on the platform. |
By allowing user-defined In order to generate the right machine code for How would such struct classes work with by-value calls? |
I had imagined that there might be some other functions in addition to |
IMHO we should remove this from the ffi MVP project and consider closing if we don't intend to implement this. |
Since all operations on structs are dispatched to the getters/settings (instance methods which can already be overriden) and the auto-generated
#sizeOf
, we can allow users to define custom struct classes by overridingsizeOf
.This would allow, for example, defining structs with different behavior (e.g. different fields) on different platforms.
The text was updated successfully, but these errors were encountered: