Skip navigation.
 
mlRe: Returning values from objc_msgSend etc
FROM : Sherm Pendley
DATE : Sat Mar 01 10:22:26 2008

On Fri, Feb 29, 2008 at 2:46 PM, Greg Parker <<email_removed>> wrote:

>
> When in doubt, write Objective-C code that returns the type you want,
> compile it, and use whichever function the generated assembly code
> chose.



What's your advice about what to do when the choice must be made at runtime?
I'm using libffi. Does it know about the implicit first argument for struct
returns? That is, do I take the moral equivalent of the suggestion in
objc/objc-runtime.h, call objc_msgSend_stret() using a struct return type
and leave the argument shuffling for ffi to handle? Or, do I call it as
declared, with a void return type, setting up the return pointer argument
myself and disregarding the comment in the header file?

Also, do you know what, if any, type promotions are relevant, and whether
libffi automatically handles them?

I'm (slowly) updating CamelBones, replacing libffcall with libffi. Ffcall is
fairly limited in its structure handling - structure components have to be
known at compile time, whereas libffi's struct definition metadata can be
assembled at run time. That capability is a must, if I'm to be able to read
.bridgesupport metadata, hence the switch.

sherm--

Related mailsAuthorDate
mlReturning values from objc_msgSend etc Duncan McGregor Feb 29, 20:05
mlRe: Returning values from objc_msgSend etc Greg Parker Feb 29, 20:46
mlRe: Returning values from objc_msgSend etc Sherm Pendley Mar 1, 10:22
mlRe: Returning values from objc_msgSend etc Greg Parker Mar 1, 14:00
mlRe: Returning values from objc_msgSend etc Bill Bumgarner Mar 1, 18:30
mlRe: Returning values from objc_msgSend etc Sherm Pendley Mar 2, 00:22
mlRe: Returning values from objc_msgSend etc Duncan McGregor Mar 3, 11:52
mlRe: Returning values from objc_msgSend etc Ronald Oussoren Mar 3, 12:10
mlRe: Returning values from objc_msgSend etc Sherm Pendley Mar 3, 12:54
mlRe: Returning values from objc_msgSend etc Sherm Pendley Mar 31, 17:19
mlRe: Returning values from objc_msgSend etc Sherm Pendley Mar 31, 17:34
mlRe: Returning values from objc_msgSend etc Jean-Daniel Dupas Mar 31, 17:54
mlRe: Returning values from objc_msgSend etc Greg Parker Mar 31, 19:03
mlRe: Returning values from objc_msgSend etc Sherm Pendley Mar 31, 23:19