3 ms·
I wonder if there's anyone who'd argue for bringing back the other kind of handles: https://developer.apple.com/library/archive/documentation/mac/Memory/Memory
by duskwuff 8y ago
I wonder if there's anyone who'd argue for bringing back the other kind of handles:
https://developer.apple.com/library/archive/documentation/mac/Memory/Memory-11.html https://developer.apple.com/library/archive/documentation/ma...
I hope not.
- pavlov 8y agoThis was my first thought too. For extra confusion, Mac handles were pointers to pointers managed by the OS while on Windows, a "handle" just meant a pointer to a struct.
- Koshkin 8y ago> Windows Originally, a handle was an index in a table of allocated memory blocks; the idea was to be able to move these blocks around without affecting the program.
- pavlov 8y agoOk, like handles on Mac OS then. Maybe they saw that this idea didn't work out so great on the Mac.
- brandonbloom 8y agoIt worked out fine for 16 bit systems and the like, just as it did on the Mac. As machines became more powerful, the need for this technique disappeared.
- johntb86 8y agoThey didn't have much choice at the time: https://blogs.msdn.microsoft.com/oldnewthing/20041104-00/?p=37393 https://blogs.msdn.microsoft.com/oldnewthing/20041104-00/?p=...
- lactoferment 8y agoThese books always reminded me of the Dungeons and Dragons manuals...
- coldcode 8y agoGiven the fixed amount of memory available back then, handles were the only way to avoid fragmentation, although you had to be careful if you required locking them temporarily. I even wrote a tech note on this when I was at Apple back then. How far we have come since then.
- Taniwha 8y agoyes this was my immediate thought after reading about handles with upper bits used for meta-data .... right before a shudder passed down my spine .... it brought back all those early bad mac memories
- wruza 8y agoIf you care to remember, please, why was it bad? Did modern hardware/software solve it or prove it okay?
- duskwuff 8y agoEarly versions of Mac OS ran on the 68000 and 68010, which had a 24-bit address bus. The upper 8 bits of the address were completely ignored, so some parts of the Memory Manager (documented in my link above!) would use those bits to store flags for handles, like "locked", "purgeable", and "resource". Seeing that Apple used these bits, some third-party developers followed suit in their own applications (or accessed those bits directly as a questionable optimization). When Apple released computers which used 68030 processors, which had a 32-bit address bus, this trick stopped working. There was an awkward period where "32-bit addressing" was an option which could be turned on and off in the Memory control panel for compatibility with older software (and hardware!) which wasn't yet "32-bit clean".
- Taniwha 8y agosure they used upper bits of addresses that the hardware of the day ignored, pretty predictably the very next hardware release (68020) supported 32-bit addresses potentially breaking just about every mac binary (initially they faked it out with a PAL in the address path, they eventually faked this out in the MMU resulting in a bit of TLB thrashing) This was definitely a case of someone not planning to be successful and not looking far enough into the future