Would you pay for GC?

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Tue Jan 25 09:58:14 UTC 2022


On Tuesday, 25 January 2022 at 09:42:25 UTC, Araq wrote:
> Only if you take the "deferred" RC route, which 
> Swift/Rust/C++/Nim do not!

What do you mean by "deferred"? RC increment when taking a 
reference from the heap, but not when the reference is taken from 
the stack + periodic stack scanning?

Actually, in C++ (and to some extent in Objective-C) you minimize 
reference counting by using programmer knowledge. You increment 
when you take it from the heap and from thereon you use a 
borrowed (raw) pointer down the call tree.

Anyway, the key problem is not solved by "deferred RC". The key 
problem can only be solved by segmenting the heap in the type 
system.





More information about the Digitalmars-d mailing list