3 ms·
conflates a few of the sub-topics and gets some of it wrong, but a good read nonetheless. my first experience with handles is from early classic macOS, "system
by jiveturkey 3y ago
conflates a few of the sub-topics and gets some of it wrong, but a good read nonetheless.
my first experience with handles is from early classic macOS, "system N" days. Most everything in the system API was ref'd via handles, not direct pointers, and you were encouraged to do the same for your own apps. Memory being tight as it was back then, I imagine the main benefit was being able to repack memory, ie nothing to do with performance as is mostly the topic of TFA.
I guess ObjC is unrelated to the macOS of olde, but does it also encourage handles somehow? I understand that one reason apple silicon is performant is that it has specific fast handling of typical ObjC references? Like the CPU can decode a handle in one operation rather than 2 that would normally be required. I can't find a google reference to substantiate this, but my search terms are likely lacking since I don't know the terminology.
- astrange 3y ago> I guess ObjC is unrelated to the macOS of olde, but does it also encourage handles somehow? No, in some ways it allows memory optimization (1. since there is no inlining, clients don't know the internals of data structures, so they're free to change behind your back 2. tagged pointer objects) and in some ways it disallows it (since all objects are heap allocations i.e. there are no value types, object trees can't be "flattened" the way C++ sometimes can). > I understand that one reason apple silicon is performant is that it has specific fast handling of typical ObjC references? It's just ARMv8. There are some features like TBI, but the security improvements are more interesting than the performance improvements.