Re: [Evolution-hackers] Why a bitfield in CamelOfflineFolder?



On Thu, 2006-11-30 at 11:07 +0100, Jules Colding wrote:
> Sorry, I must be dim-witted here, but I don't understand your answer.
> The present definition of CamelOfflineFolder has:
> 
> unsigned int sync_offline:1;
>                          ^^    <== bit field 
> 
> I'm asking why we don't simply do:
> 
> gboolean sync_offline;
> 
> instead?

I'm presuming to save memory -- maybe the folder is nested in another
struct and the compiler can compact the bitfields into a single word.

However that doesn't appear to be the case so in this situation a
gboolean would use the same amount of memory as the int:1.  I'm guessing
this was a style choice: always use a bitfield so future boolean flags
are compacted.

Ross
-- 
Ross Burton                                 mail: ross burtonini com
                                          jabber: ross burtonini com
                                     www: http://www.burtonini.com./
 PGP Fingerprint: 1A21 F5B0 D8D0 CFE3 81D4 E25A 2D09 E447 D0B4 33DF

Attachment: signature.asc
Description: This is a digitally signed message part



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