On 17/09/2023 12:25 AM, sighoya wrote:
On Saturday, 16 September 2023 at 10:22:31 UTC, Richard (Rikki) Andrew
Cattermole
wrote:
The approach that I think will work well for us is to support
reference counting on structs & classes, and make them not adhere to
DIP1000.
Does that mean you are against dip1000 or do you want both?
Basically DIP1000 handles the final leg of lifetime management, rather
than managing the actual ownership of memory. It comes into play after
you borrow from a container.
I will be doing the DIP for RC due to its cost of it and the fact that
modern backends do understand it and can make it cheaper.
Will it be automated reference counting with a special type of GC doing
the job or a local RC container?
Its basically what we do now with copy constructors + destructors, but
inside dedicated methods.
Although I do want a write barrier on each struct/class, to allow for
cyclic handling especially for classes.