Tagged pointers.

In 64 Bit cocoa for small value like objects for NSNumber, NSValue, NSDate etc the object is stored in the pointer itself. In addressing modes the 4 least significant bits are unused for pointers to NSObjects. The least significant bit is used as a flag to indicate whether the pointer is tagged or not. If tagged the data is actually stored in the pointer. This is three times more space efficient and 100 times faster to allocate and destroy.
Read the rest of this entry »

Tags: , ,