Is a moving GC really needed?

Sean Kelly sean at f4.ca
Wed Oct 4 16:02:13 PDT 2006


Marcio wrote:
> 
>     I also don't see how a moving GC can live with the D features. I 
> know that having a non-moving GC can have people produce code that is 
> not portable across compiler implementations. I have seen this happen 
> with code for SmartEiffel versus ISE Eiffel for example. Using 
> SmartEiffel, people cached pointers to Eiffel objects from C DLLs etc. 
> Worked in SmartEiffel (non-moving GC), but not in ISE Eiffel (moving GC).

I'll admit I've wondered about this.  Without sufficient type 
information the GC has no way of knowing whether a particular 32-bit (or 
64-bit) value that *could be* a pointer actually *is* a pointer and 
therefore should be altered when a move occurs.  Assuming the type 
information is present however, it should be simple enough to state that 
pointers must be typed as such (ie. it is illegal to store a pointer in 
a byte[4], for example).  In fact, I think D already has this 
restriction in place.


Sean



More information about the Digitalmars-d mailing list