• 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: Some in-depth Obj-C runtime questions.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Some in-depth Obj-C runtime questions.


  • Subject: Re: Some in-depth Obj-C runtime questions.
  • From: Christopher Lloyd <email@hidden>
  • Date: Mon, 02 Jul 2001 16:00:46 -0400

At 12:42 AM 7/2/2001 -0700, you wrote:
Can I safely assume that the size of any argument can be obtained by just tallying up the sizes of all the f's, i's, :'s, etc?

Not really, you have to worry about promotion on arguments and alignment in structures. NSInvocation, NSMethodSignature and NSGetSizeAndAlignment() do all of the work for you though.

How is [NSMethodSignature description] obtaining the offsets of each of these elements? Is it pulling them out of the runtime, or relying on the type encoding?

Pretty sure it uses the type encoding only. There are some numbers floating around in the type signatures, but I think they are ignored. You can initialize an NSMethodSignature with just the type encoding and it will do the right thing. There is a private method +(NSMethodSignature *)signatureWithObjCTypes:(const char *)types; - this exists on YB/NT, haven't checked if it's still there on OS X, probably is.

One other question, is why is self's offset 128 bytes from the beginning of the stack frame? What all is in the stack frame besides the return address?

Not sure, maybe the register set?

Hope this helps,
Chris


References: 
 >Some in-depth Obj-C runtime questions. (From: "John C. Randolph" <email@hidden>)

  • Prev by Date: Re: boolean into NSDictionary
  • Next by Date: Re: This may be a bit of a twisted idea...
  • Previous by thread: Some in-depth Obj-C runtime questions.
  • Next by thread: Re: Some in-depth Obj-C runtime questions.
  • Index(es):
    • Date
    • Thread