Re: BOOL array
Re: BOOL array
- Subject: Re: BOOL array
- From: "Chris Holloway" <email@hidden>
- Date: Thu, 11 Sep 2008 14:47:09 +0100
No, CFBit is just declared to be used in the interface of CFBitVector.
Look at http://http://src.gnu-darwin.org/DarwinSourceArchive/expanded/CF/CF-299/Collections.subproj/CFBitVector.c,
in particular the function __CFBitVectorBit. Each value has 1 bit of
overhead. Anything more is a needless waste.
2008/9/11 dreamcat7 <email@hidden>:
>
> On 11 Sep 2008, at 13:08, Jean-Daniel Dupas wrote:
>>
>> That's fine if you love to reinvent the wheel, but that exactly the
>> interface provided by CFMutableBitVector.
>>
>> CFBitVectorCreateMutable()
>> CFBitVectorSetBitAtIndex()
>> CFBitVectorGetBitAtIndex()
>>
>>
>> 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;
>
> Availability
>
> * Available in Mac OS X v10.0 and later.
>
> Declared In
> CFBitVector.h
>
> Incedentally if you do use NSMutableData to store your BOOLs (which ARE
> typedef signed char and hence 8-bits anyway), you are casting them to a
> char* which is very 'c-ish'. So you can then store 'C' bit array or any
> other byte-aligned c-type. So its not that bad !
>
>
> _______________________________________________
>
> 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
>
_______________________________________________
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