At 14:22 +0100 11/9/08, dreamcat7 wrote:
On 11 Sep 2008, at 13:08, Jean-Daniel Dupas wrote:
And it probably does it better as it will not waste 7 bits for each option.

No, in a CFBitVector there is 4-bytes for each bit.

CFBit

A binary value of either 0 or 1.

typedef UInt32 CFBit;

The CFBit type is used only for parameters, it is not indicitive of how the bits are actually stored.

You can see the source code for a version of CFBitVector at

<http://src.gnu-darwin.org/DarwinSourceArchive/expanded/CF/CF-299/Collections.subproj/CFBitVector.c>

/* The bucket type must be unsigned, at least one byte in size, and a power of 2 in number of bits; bits are numbered from 0 from left to right (bit 0 is the most significant) */

    __CF_BITS_PER_BYTE = 8
    __CF_BITS_PER_BUCKET = (__CF_BITS_PER_BYTE * sizeof(__CFBitVectorBucket))

etc.

Of course there is no guarentee as to the storage, but I think it's safe to assume a guarantee of a little more than 1 bit per BOOL.

Enjoy,
   Peter.

--
              Keyboard Maestro 3 Now Available!
                Now With Status Menu triggers!

Keyboard Maestro <http://www.keyboardmaestro.com/> Macros for your Mac
<http://www.stairways.com/>           <http://download.stairways.com/>
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to