[D-runtime] Precise garbage collection

Leandro Lucarella leandro.lucarella at sociomantic.com
Thu Aug 8 07:11:26 PDT 2013


On Wed, Aug 07, 2013 at 11:10:37PM +0200, Rainer Schuetze wrote:
> On 07.08.2013 18:18, Leandro Lucarella wrote:
> >On Fri, Jun 21, 2013 at 11:37:45PM +0200, Rainer Schuetze wrote:
> >>The size value itself is only a small issue, the larger one is the
> >>address of the array data moves depending on the size of the
> >>allocation, so the pointer info needs to be placed at some offset
> >>sometimes. My first implementation actually figured this out in
> >>the GC, but I think this leaks too much implementation details of
> >>the array into the GC. So I changed it to use gc_emplace instead.
> >
> >Any reason not to use a more obvious name like setType() or similar?
> >
> 
> I liked how it pairs quite well with std.emplace. But I'm open to
> suggestions, I'll note yours as gc_settype.

But emplace in that sense doesn't have a quite different meaning? One is
initializing the content of the memory and the other just the
"metadata". That's why I found it a bit confusing, because at first I
thought it was messing with the actual memory block.

I guess is OK once you get used to it anyway though...

-- 
Leandro Lucarella
Senior R&D Developer
Sociomantic Labs GmbH <http://www.sociomantic.com>


More information about the D-runtime mailing list