• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: BOOL array
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: BOOL array


  • Subject: Re: BOOL array
  • From: Peter N Lewis <email@hidden>
  • Date: Thu, 11 Sep 2008 22:03:43 +0800

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 (email@hidden)

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:
This email sent to email@hidden


References: 
 >Re: BOOL array (From: dreamcat7 <email@hidden>)
 >Re: BOOL array (From: Jean-Daniel Dupas <email@hidden>)
 >Re: BOOL array (From: dreamcat7 <email@hidden>)

  • Prev by Date: Re: Do I Need Multiple NSArrayControllers For This?
  • Next by Date: Re: NSPredicate BETWEEN inclusive or exclusive?
  • Previous by thread: Re: BOOL array
  • Next by thread: Re: BOOL array
  • Index(es):
    • Date
    • Thread