October 01, 2005
Sean Kelly wrote:

> In article <dhi5v8$fl7$1@digitaldaemon.com>, Wolfgang Draxinger says...
>>
>>The memory management of my component system was designed with a relocation GC in mind, but it can also work with raw memory and offers an interface to smart memory handles, that operate on a address range, separated from the raw heap.
>>
>>But thinking of how this could be put in D.
> [snip]
> 
> Frankly, I think it must be one way or the other in D.  I don't
> want to have to
> deal with pointers in some instances and handles in another.
> That just seems
> like needless complexity for the most part.  And it would also
> be a tad odd to have classes referenced by handles but all
> other dynamic types referenced by
> pointers.    Using dynamic type info would allow a moving GC to
> work with
> pointers as easily as handles anyway.

Then you however loose interoperability with libraries not moving GC safe. The only thing to prevent this is explicitly locking the memory, which is however error prone, since one could forget this. Such bugs are nasty to track down, because they're difficult to reproduce: you can't predict, that the GC will do the same move with every instance, or at different times of execution.

> The sticking point for
> me (as I've mentioned before) is that class references omit the
> pointer specifier, which I find completely misleading.  Even if
> we never had stack-based classes, it would be nice if the '*'
> were required for class references, assuming they are
> guaranteed to be pointers.

That's an argueable point.

-- 
Wolfgang Draxinger

1 2
Next ›   Last »