Garbage Collection for Systems Programmers

Dukc ajieskola at gmail.com
Wed Apr 10 11:56:28 UTC 2024


On Tuesday, 9 April 2024 at 16:54:03 UTC, Walter Bright wrote:
> On 4/9/2024 6:50 AM, Dukc wrote:
>> If the write gate would just ignore any pointers not 
>> registered to the GC it would probably continue to work with 
>> existing code with no changes other than a slight slowdown.
>
> This appears to require that the language would be cognizant of 
> two different pointer types - gc pointers, and non-gc pointers. 
> This concept was implemented in Microsoft's "Managed C++" 
> language.

No, you misunderstood. There would be only one pointer type, 
whether it's write-gated would be controlled by a version switch.

What I meant is: *if* the write-gates are turned on, the write 
gate would check *at runtime* whether the memory pointed to by 
the new value is registered to the GC. If not, nothing is done 
apart from the assignment. Meaning, pointing to memory not 
controlled by the GC would still work, although the pointer 
writes would be slower than if write gates were not used.

There would be no difference in language semantics. Both 
GC-controlled memory and manually allocated memory work exactly 
the same in both cases. The difference would only be in 
performance.


More information about the Digitalmars-d mailing list