-
Notifications
You must be signed in to change notification settings - Fork 23
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
lostanza - passing/return struct by value in C #174
Comments
This is a working code from current GC implementation passing and returning small structures by value: ;Write the live range r into the heap address at the given break location. ;Read the live range at the given break location. |
Sorry - I should have been more specific with what I am trying to do. What I want to do is wrap GSL's complex value implementation. It passes a struct The It is not clear to me how I can use the Below has gotten me the farthest towards my goal:
This sadly fails with Is there another way to do this ? |
Hi Carl, What you are trying to do is reasonable, and is the way that it should (and will ultimately) be done. You're hitting a part of the compiler that is not-yet-implemented today: the C calling convention for structs. Until that is finished, you have to write an additional C-wrapper that changes how Our apologies. It's on the near-term roadmap however! |
In C - you can pass or return a defined struct by value from a function. For example - see the GSL complex math library.
I can't seem to work out how to do this in lostanza. It seems like lostanza is focused only on pointers. Do you have an example of using structures as values?
The text was updated successfully, but these errors were encountered: