Idea #1 on integrating RC with GC
Jameson Ernst
jameson at example.com
Thu Feb 6 16:06:36 PST 2014
On Thursday, 6 February 2014 at 23:13:11 UTC, Marco Leise wrote:
> The intent is to make it possible to avoid the GC, but if I
> understand you correctly you talk about always allocating
> through the GC first.
One of the ideas on the table is to use ARC backed by the GC to
clear cycles, which would mean the GC needs to be aware of all
allocations anyway so it can scan and clear them if a cycle is
formed. It's not safe to start reference counting GC memory at an
arbitrary time after allocation, since references to it could be
anywhere, but if you have a unique expression, then you know
there are no other references to the new data, so it's safe to
begin reference counting it at that time before it propagates out
into the program at large.
More information about the Digitalmars-d
mailing list