Re: Which flavor of objc_msgSend for NSSize return
Re: Which flavor of objc_msgSend for NSSize return
- Subject: Re: Which flavor of objc_msgSend for NSSize return
- From: Rosyna <email@hidden>
- Date: Fri, 11 May 2007 13:00:34 -0700
I actually just ended up doing what people kept telling me to do.
Compile some objective-c code that calls the function, disassemble,
and see what gcc does.
GCC calls objc_msgSend() on i386 if the type is NSRange or NSSize.
Using stret for these is declared as bad/wrong by some people since
the handling is very different on i386 for structs <=8 bytes. (But
golly, I can't remember where I saw an official document on what
small meant).
But either way, I'd like to see an official document dealie
describing which to use in which case. I would hate to be depending
on an implementation detail. Especially when the entire point of this
particular piece of code is to make sure I can adapt if the
implementation changes.
Ack, at 5/11/07, Sherm Pendley said:
On May 11, 2007, at 3:13 PM, Rosyna wrote:
I'm trying to call a method that returns an NSSize on i386. Do I
use objc_msgSend, _fpret, or _stret?
CamelBones uses _stret for all of NSPoint, NSRange, NSRect, and
NSSize. It only uses _fpret on Intel if the return is a plain old
float or double, not a struct of any sort.
NSSize is small, so the size qualifies for the plain objc_msgSend.
"Small" is small enough to fit in one register, but two floats don't.
--
Sincerely,
Rosyna Keller
Technical Support/Carbon troll/Always needs a hug
Unsanity: Unsane Tools for Insanely Great People
It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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