low-latency GC

Max Haughton maxhaton at gmail.com
Sun Dec 6 14:11:41 UTC 2020


On Sunday, 6 December 2020 at 11:35:17 UTC, Ola Fosheim Grostad 
wrote:
> On Sunday, 6 December 2020 at 11:27:39 UTC, Max Haughton wrote:
>> [...]
>
> 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.
>
>> [...]
>
> 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.

https://gcc.godbolt.org/z/bnbMeY


More information about the Digitalmars-d-learn mailing list