In September 2013, Apple introduced the iphone5s, while IPhone5S was equipped with the first A7 dual-core processor with 64-bit architecture, and Apple proposed the concept of tagged pointer in order to save memory and improve execution efficiency.
For 64-bit programs, when the tagged pointer is introduced, the associated logic can reduce the memory footprint by half, and 3 times times the access speed, and 100 times times the creation, the destruction speed increases.
Second, when 8 bytes can host the numeric value used for the representation, the system generates pointers in the form of tagged pointer, and if the 8 bytes are not able to be loaded, then the normal pointers are generated in the previous way.
Thirdly, Tagged pointer is used to store data directly in the pointer itself by setting a special tag at its last bit bit. Because tagged pointer is not a real object, we need to be careful not to directly access its ISA variable when we use it.
Reference: iOS Development advanced-Tang Qi
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Ios-tagged pointer objects-Considerations