In “some” ways, it’s a bit like a smart pointer as it’s a hook to allow the underlying system to “do things” in a hidden way.
(The article's examples are in Pascal, the original language of choice for the Mac.)
The article got virtual memory wrong to a bit.. it got much better over the years and using relocatable handles fell by the wayside to more plain pointers.
I guess there was some simple pre-allocated larger block that got parts handed out on demand. Not unlike a modern implementation.
I still miss MPW Shell.
https://learn.microsoft.com/en-us/windows/win32/memory/compa...
Microsoft released the first version of Excel for the Macintosh on September 30, 1985, and the first Windows version was 2.05 (to synchronize with the Macintosh version 2.2) on November 19, 1987. https://en.wikipedia.org/wiki/Microsoft_Excel#Early_history
ref used many of the tricks described in the above post, including an incrementing counter to catch stale handles.
All pointers were converted to handles in debug and testing builds, but in release builds ref simply returned the pointer as a handle, to avoid the performance penalty. As machines grew faster, there was talk of never turning off ref.
Side win: There was a unit called "xref" (external ref) which converted pointers to stable handles in all builds (debug and release). It was the same code, but it was not compiled out in release builds. External refs were used as network handles in the server's bespoke RPC protocol.