You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been looking at this project recently and trying to understand it and potentially use it for an embeddable scripting language. however I got confused when it got to return values, I've been mostly exploring the language via c2m and wanted to see how it handled compund(non primitive) return types, so I have the following c code
What is the f:4(fp):f and i32:(fp):i doing exactly, I'm guessing dereferencing and casting, but I'm not exactly sure
Why not use p instead of i64 for pointers(gotten from alloca)
Is the alloca memory not freed once outside the function, from what i see the pointer to the memory is returned, when if not at the end of a function is alloca memory freed?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I've been looking at this project recently and trying to understand it and potentially use it for an embeddable scripting language. however I got confused when it got to return values, I've been mostly exploring the language via c2m and wanted to see how it handled compund(non primitive) return types, so I have the following c code
the corresponding generated mir is
I have a few questions
f:4(fp):f
andi32:(fp):i
doing exactly, I'm guessing dereferencing and casting, but I'm not exactly surep
instead ofi64
for pointers(gotten fromalloca
)Beta Was this translation helpful? Give feedback.
All reactions