low-latency GC

Ola Fosheim Grostad ola.fosheim.grostad at gmail.com
Sun Dec 6 11:35:17 UTC 2020


On Sunday, 6 December 2020 at 11:27:39 UTC, Max Haughton wrote:
> ARC with a library will have overhead unless the compiler/ABI 
> is changed e.g. unique_ptr in C++ has an indirection.

No, unique doesnt need indirection, neither does ARC, we put the 
ref count at a negative offset.

shared_ptr is a fat pointer with the ref count as a separate 
object to support existing C libraries, and make weak_ptr easy to 
implement. But no need for indirection.

> The AST effectively is a high-level IR. Not a good one, but 
> good enough. The system Walter has built shows the means are 
> there in the compiler already.

I think you need a new IR, but it does not have to be used for 
code gen, it can point back to the ast nodes that represent ARC 
pointer assignments.

One could probably translate the one used in Rust, even.


More information about the Digitalmars-d-learn mailing list