Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

IIRC you store (23 - size) in the last byte in "small string" mode, so when the size gets to 23, the last byte is 0, doubling as the null terminator.


Surely it must be (23 - size) << 1, otherwise you won't guarantee a 0 in the LSB.


On little endian systems it uses two MSb's, on big endian systems it uses two LSb's. There are actually two flag bits.


If you use the LSB of the last byte for a flag, you're using the 56th bit of one of the {data,size,cap} words. I'd use the MSB in this case, since you can shift that off easier.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: