[Issue 5057] std.variant.Algebraic-aware GC

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Oct 9 19:52:06 PDT 2012


http://d.puremagic.com/issues/show_bug.cgi?id=5057



--- Comment #6 from bearophile_hugs at eml.cc 2012-10-09 19:28:00 PDT ---
(In reply to comment #5)
> Let us revisit this if it ever becomes a problem in practice; I very much doubt
> it. At any rate, special-casing it in the GC is the wrong kind of design.
> 
> I'll also add that I'm against adding GC heap allocation to Variant/Algebraic
> as this would severely slow down code that uses many instances of these types
> for no good reason.

I agree that special casing for Algebraic is probably too much.

But GC precision is a problem, especially on 32 bit system. 

And here I was not discussing about allocating an Algebraic on the heap, but
the problems caused by putting references to heap-allocated things inside an
Algebraic. So it's a problem shared by all unions. The idea of "onScan" is
general, it's not a special case for Algebraic, it's usable to help the GC for
all unions (but it's especially useful for Algebraic because it has a tag).

Maybe I will open an enhancement request about all unions...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list