• 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: struct size?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: struct size?


  • Subject: Re: struct size?
  • From: Erick Tejkowski <email@hidden>
  • Date: Sat, 11 Mar 2006 13:45:01 -0600

So, it sounds like there is a consensus that it's padded. Makes sense. Thanks for the help Tim and Phillipe.

Erick

On Mar 11, 2006, at 1:32 PM, philippe wicker wrote:


On Mar 11, 2006, at 7:50 PM, Erick Tejkowski wrote:

Can anyone help me figure out why SizeOf reports that the size of a ScheduledAudioFileRegion struct is 96 bytes, but when I add the numbers up in my head, it comes to 92? I've appended sizes to each struct member below to show you how I came up with 92. Any ideas what I am calculating wrong?

You're simply not calculating the same way as the C++ compiler does :) Your struct contains 8 bytes length fields (mStartFrame and some other fields within AudioTimeStamp) so it has an alignment constraint of 8. 92 is not evenly divisible by 8, 96 is. So the compiler allocates a size of 96 bytes to your struct. There exist some pragmas that tells the compiler to use different alignment constraints but I don't remember what they are.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >struct size? (From: Erick Tejkowski <email@hidden>)
 >Re: struct size? (From: philippe wicker <email@hidden>)

  • Prev by Date: Re: struct size?
  • Next by Date: CoreAudio.jar, AudioDeviceIOProc and ADevicePropertyListener
  • Previous by thread: Re: struct size?
  • Next by thread: CoreAudio.jar, AudioDeviceIOProc and ADevicePropertyListener
  • Index(es):
    • Date
    • Thread