Re: [AMBER-Developers] (no subject)

From: case <case.biomaps.rutgers.edu>
Date: Sun, 25 Sep 2011 16:51:47 -0400

On Sun, Sep 25, 2011, dcerutti.rci.rutgers.edu wrote:

> However, it seems that a struct like
>
> struct iddd {
> int it1;
> double db1;
> double db2;
> double db3;
> };
> typedef struct iddd id3;
>
> will show up as 32 bytes if I do sizeof(id3) even though

Exactly: doubles (and structs themselves) have be aligned on 8-byte
boundaries, so the compiler has to add padding after the first int so that
the double that follows it is properly aligned.

...dac


_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Sun Sep 25 2011 - 14:00:02 PDT
Custom Search