Do we have any implementation of ref-counted class instances? İf not why?
Thread overview | ||||||
---|---|---|---|---|---|---|
|
May 10, 2023 what is the aftermath of dip74 | ||||
---|---|---|---|---|
| ||||
May 11, 2023 Re: what is the aftermath of dip74 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ferhat Kurtulmuş | We do not, no. Reference counting is not currently in the language, although you can fake it with structs. Its a huge shame, but it should be added at some point because the compiler would tell the backend that it is possible to elide pair calls. However it'll have to wait for the DIP queue to reopen (slight process adjustment to make things easier is incoming). |
May 10, 2023 Re: what is the aftermath of dip74 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Richard (Rikki) Andrew Cattermole | On Wednesday, 10 May 2023 at 18:15:36 UTC, Richard (Rikki) Andrew Cattermole wrote:
> We do not, no.
>
> Reference counting is not currently in the language, although you can fake it with structs.
>
> Its a huge shame, but it should be added at some point because the compiler would tell the backend that it is possible to elide pair calls.
>
> However it'll have to wait for the DIP queue to reopen (slight process adjustment to make things easier is incoming).
Thank you Rikki for the clarification. I think d need this without ugly workarounds.
|
May 11, 2023 Re: what is the aftermath of dip74 | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ferhat Kurtulmuş | On 11/05/2023 6:23 AM, Ferhat Kurtulmuş wrote:
> Thank you Rikki for the clarification. I think d need this without ugly workarounds.
Yeah we do.
Reference counting is expensive, and modern backends have the capability to elide pairs of calls. So this would be a massive improvement just from the perspective of performance alone.
|
Copyright © 1999-2021 by the D Language Foundation