• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Returning values from objc_msgSend etc
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Returning values from objc_msgSend etc


  • Subject: Re: Returning values from objc_msgSend etc
  • From: Ronald Oussoren <email@hidden>
  • Date: Mon, 03 Mar 2008 03:10:40 -0800

On Monday, March 03, 2008, at 11:53AM, "Duncan McGregor" <email@hidden> wrote:

>> I can simply check the calculated size after calling ffi_prep_cif(), and compare that to sizeof(void*) to see if the return value will fit in a register.
>
>Is that right? 8 byte structs are returned in EAX and EDX on IA-32, so
>I'd expect to call objc_msgSend.

The rules are a bit more complex than this (at least on x86). Small structs are returned in registers (upto 8 bytes), but only if the size of the struct is a power of 2. That is, a 6-byte struct will not be returned in registers. I haven't checked recently if the ABI documentation reflects reality, in 10.4 days it didn't.

Ronald

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Returning values from objc_msgSend etc
      • From: "Sherm Pendley" <email@hidden>
References: 
 >Re: Returning values from objc_msgSend etc (From: "Sherm Pendley" <email@hidden>)
 >Re: Returning values from objc_msgSend etc (From: Greg Parker <email@hidden>)
 >Re: Returning values from objc_msgSend etc (From: "Sherm Pendley" <email@hidden>)
 >Re: Returning values from objc_msgSend etc (From: "Duncan McGregor" <email@hidden>)

  • Prev by Date: [ANN] UKCrashReporter 0.3
  • Next by Date: Re: Reading word at mouse pointer w/o Universal Access
  • Previous by thread: Re: Returning values from objc_msgSend etc
  • Next by thread: Re: Returning values from objc_msgSend etc
  • Index(es):
    • Date
    • Thread