Re:OBNC Oberon Compiler
by pankajdoharey on Sunday September 02, 2018 @08:57AM
(#17896809)
Actually before Apple implemented ARC in its OS Around Mac OS X Lion and iOS 5, the Objective-C runtime in Mac OS X was a garbage collection runtime.
[ Parent
| on HN ]
Wikipedia describes GC as being automatic memory management. I don't think it is valid to describe the traditional (pre-2007) osx/objective-c model of manual reference counting as a form of garbage collection.
Darwin itself is mostly unix+C. Hence, this does not respond to the parent, asking about GC in the OS itself.
>Darwin itself is mostly unix+C. Hence, this does not respond to the parent, asking about GC in the OS itself.
You're right, but just to clarify WRT your first paragraph, Obj-C did briefly have a GC'd runtime between the eras of manual and automatic ref counting.
As you and neighbour inferred, I had not know of this. Thanks.
Objective-C 2.0 got a tracing GC, which was later replaced by ARC, because it was a failure.
Although it was possible to link frameworks compiled in mixed modes, it lead most of the time to crashs and the C semantics did not help.
Hence the pragmatic solution of ARC, which basically has the compiler inserting the retain/release calls that used to be done manually.
While not the same, it was a good enough solution.
https://developer.apple.com/documentation/foundation/object_...
Re:OBNC Oberon Compiler
by cellularmitosis on Monday September 03, 2018 @01:35AM
(#17900547)
That was true for Mac OS but not for iOS. You had to manage memory manually with alloc and release.