Florian Krohm wrote:
> On Monday 15 December 2008 05:43:20 [email protected] wrote:
>> However it is possible to pack the structs without holes...
>
> Huh?
>
> struct foo {
> int x : 2;
> };
>
> GCC will allocate at least 1 byte of memory for this struct
> independent of -fpack-struct.
Any conforming compiler must allocate at least sizeof(int) bytes.
However, for that specific struct, it is possible for a compiler
to widen all writes to 'x' so that sizeof(int) bytes are written.
This will avoid the hole as far as memcheck is concerned.
Obviously such widening is not possible in the next case:
struct foo {
int x : 2;
int y : 30;
};
--
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users