3 ms·
Since most pointers in macOS are 4-byte aligned (guaranteed by malloc), you can use the low bits for flags without having to shift anything. Of course Obj-C al
by astrange 9y ago
Since most pointers in macOS are 4-byte aligned (guaranteed by malloc), you can use the low bits for flags without having to shift anything.
Of course Obj-C already uses this for tagged-pointer numbers/strings/etc, so you've got competition if you want to start using this for something.