Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Re: OCaml speed
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Ken Rose <kenarose@e...>
Subject: Re: [Caml-list] Re: complex bigarrays
Thorsten Ohl wrote:

> AFAIK, the C compiler is free to pad structures for better alignment,
> resulting in better performance.  Isn't it even free to reorder
> elements?

No, it's not free to reorder them.  C89, section 6.5.2.1 semantics,
paragraph 9

"Within a structure object, the non-bit-field members and the units in
which bit-fields reside have addresses that increase in the order in
which they are declared."

They can be padded anywhere except at the beginning.

 - ken
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr