[Issue 3463] Integrate Precise Heap Scanning Into the GC

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 1 12:36:24 PST 2009


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



--- Comment #6 from David Simcha <dsimcha at yahoo.com> 2009-11-01 12:36:22 PST ---
> > 3.  The mixin is because I needed a lot of the same logic in realloc() and
> > extend() and it was complicated enough that I felt it was the lesser of two
> > evils to use a mixin, even with the "variables appearing out of nowhere" magic,
> > rather than duplicate that logic.
> 
> Sure, duplicating code is never a good idea. The question is, why it can't be
> done with a plain-old function?

Because I needed to dump a whole bunch of variables (not just 1) into the stack
frames of realloc() and extend() and the only way this could have been done
with a plain old function would be to create a struct, create a function that
returns the struct, etc. or to use lots and lots of out paramters.  I really
felt the mixin was the least unclear way that this logic could be injected into
both extend() and realloc().

-- 
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