Migrating an existing more modern GC to D's gc.d

Paulo Pinto pjmlp at progtools.org
Wed Apr 11 07:13:47 UTC 2018


On Tuesday, 10 April 2018 at 18:31:28 UTC, Jacob Carlborg wrote:
> On 2018-04-10 08:47, Jonathan M Davis wrote:
>
>> Regardless, I think that it's clear that in order to do 
>> anything with
>> thread-local pools, we'd have to lock down the type system 
>> even further to
>> disallow casts to or from shared or immutable, and that would 
>> really be a
>> big problem given the inherent restrictions on those types and 
>> how shared is
>> intended to be used.
>
> Apple's GC for Objective-C (before it had ARC) was using 
> thread-local pools. I wonder how they manged to do that in a 
> language that doesn't have a type system that differentiates 
> between TLS and shared memory.

They were doing it quite bad.

One of the reasons that always gets lost when discussing the 
merits of ARC over GC in Objective-C, is that Apple never managed 
to make the GC work without issues given its underlying C 
semantics.

So naturally having the compiler do what developers were already 
doing by hand with Framework derived classes was a safer way than 
ensuring Objective-C's GC would never crash.

Apple used to have a GC caveats document that was long taken down 
from their site.

This is one of the few surviving ones,

https://developer.apple.com/library/content/releasenotes/Cocoa/RN-ObjectiveC/#//apple_ref/doc/uid/TP40004309-CH1-DontLinkElementID_1


More information about the Digitalmars-d mailing list