On Thu, Oct 22, 2009 at 3:57 PM, Scott James Remnant <email address hidden>wrote:
> Shouldn't it be something more like:
>
> __allocof__ (struct) * ((sizeof (struct) - 1) / __allocof__ (struct) +
> 1)
>
> Not entirely sure how __allocof__ works?
>
>
I used __alignof__. While I had some trouble finding docs, it appears to
work fairly simply. When given a type, it will return the number of bytes of
padding needed to reach proper memory alignment. For example, the
NihAllocCtx struct has sizeof 20 on my system, and __alignof__(NihAllicCtx)
returns 4. In theory on x86 it would return 0 and hopefully the compiler
will be smart enough to optimize it out.
On Thu, Oct 22, 2009 at 3:57 PM, Scott James Remnant <email address hidden>wrote:
> Shouldn't it be something more like: _(NihAllicCtx)
>
> __allocof__ (struct) * ((sizeof (struct) - 1) / __allocof__ (struct) +
> 1)
>
> Not entirely sure how __allocof__ works?
>
>
I used __alignof__. While I had some trouble finding docs, it appears to
work fairly simply. When given a type, it will return the number of bytes of
padding needed to reach proper memory alignment. For example, the
NihAllocCtx struct has sizeof 20 on my system, and __alignof_
returns 4. In theory on x86 it would return 0 and hopefully the compiler
will be smart enough to optimize it out.
> We'll need you to follow upstart. ubuntu. com/wiki/ CopyrightAssign ment for this patch
> http://
>
>
I will do this immediately.
katre