[OLPC-devel] Announce: Compressed cache 'pre-alpha-001' release :)

Nitin Gupta nitingupta.mail at gmail.com
Thu Jul 27 15:36:40 EDT 2006


Zach Brown wrote:
>> Again __set_bit()/__clear_bit() take unsigned long while chunk->size is
>> unsigned short. Can it cause problem if I cast this chunk->size to
>> unsigned long and pass to them?
>
> _Yes_.  That's what I said in the first mail and why I brought it up to
> begin with!  Maybe architectures (like i386!) implement it with assembly
> that will write to the entire long when setting a given bit.
>
> - z
>
Ok, then I will do with this (as posted earlier):

#define ChunkFree(chunk)        \
        (!!(chunk->size & (1 << CHUNK_FREE)))
#define SetChunkFree(chunk)        \
        (chunk->size |= (1 << CHUNK_FREE))
#define ClearChunkFree(chunk)        \
        (chunk->size &= ~(1 << CHUNK_FREE))


-- Nitin




More information about the Devel mailing list