Re: Returning structs in c_func
- Posted by mattlewis (admin) Jul 03, 2013
- 2187 views
We'd have to figure out how to get that stuff off the stack. Yuck.
Hmm. Is this really more difficult than doing some pop() calls, like older versions of be_callc.c used to do for integer return types?
Could be. I just have no clue, personally.
And I suspect it will work differently on different architectures. Double yuck.
I would have thought that this would actually depend on calling convention... I see no reason for the assembly code to work differently on an ARM vs x86-64 for this case.
Possibly. But they're all finicky in different ways.
I would rather return a sequence containing the data as it would appear if you peeked it as a memstruct.
I agree that this is the better approach, but we'd need to support memstructs first before this can be done.
Yes. But it makes my head hurt to think that we're going to do it wrong.
Matt