Re:Inside D's GC
by chrisseaton on Tuesday June 20, 2017 @04:19AM
(#14592925)
Presumably adding precise stack maps and object maps would be the first step of adding IMMIX. I mean it's the compiler that chooses where to place things in the heap and the stack, so it already knows where they are.
[ Parent
| on HN ]
Re:Inside D's GC
by readittwice on Tuesday June 20, 2017 @05:02AM
(#14593053)
Since, I don't know D, I am curious whether D-code is written in such a way that objects are assumed to be non-moving, especially when interfacing with C.
The spec says the GC may move, though the current GC doesn't do that:
https://dlang.org/spec/garbage.html#obj_pinning_and_gc
There's also been some work on a precise GC for D:
> written in such a way that objects are assumed to be non-moving
Not generally, but you can take the address of anything and shove it into a union or pass it off to C code that stores it somewhere. Because you can, it would be very dangerous to move objects around because of that.
Re:Inside D's GC
by chrisseaton on Tuesday June 20, 2017 @05:34AM
(#14593202)
Ah, yes maybe FFI and also perhaps inner pointers.