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

Reply via email to