Re: [lc-devel] [OLPC-devel] Announce: Compressed cache 'pre-alpha-001' release :)
Status: Beta
Brought to you by:
nitin_sf
From: Nitin G. <nit...@gm...> - 2006-07-27 19:35:13
|
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 |