[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Little help with blk ring

>>> On 23.05.12 at 10:54, Daniel Castro <evil.dani@xxxxxxxxx> wrote:
> On Wed, May 23, 2012 at 5:20 PM, Jan Beulich <JBeulich@xxxxxxxx> wrote:
>>>>> On 23.05.12 at 01:43, Daniel Castro <evil.dani@xxxxxxxxx> wrote:
>>> On Tue, May 22, 2012 at 8:53 AM, James Harper 
>>> <james.harper@xxxxxxxxxxxxxxxx> 
> wrote:
>>>> Is sizeof() what you expect it to be? That would cause the first request to
>>> be (mostly) okay, but subsequent requests to be further and further out of
>>> alignment.
>>> Right on the spot!
>>> Here is the output of sizeof for the struct and for each member:
>>> SIZEOF ring_res:12 id:8 operation:1 status:2
>>> There is seems to be an alignment problem, them sum of members is 11,
>>> but the whole struct is 12, the question now is, how can I tackle this
>>> problem?
>> But sizeof is 12, as expected. There should be no place in your
>> code where you (directly or indirectly) sum up the individual
>> members' sizes.
> But if you add the members it is id:8 + operation:1 + status:2 = 11.
> Am I missing something?

As said - the sum of the members' sizes should not be used
(and hence not matter) in your code. I'm not clear why you're
insisting on this calculation having any relevance.


Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.