> Mixing D's gc world with manually managed memory isn't 
> hard, as long as  the following rules are followed:
> 
> 1. don't allocate in one language and expect to free in another
> 2. keep a 'root' to all gc allocated data in the D side of the fence 
> (otherwise it may get collected)

Yes it's the second that's the tough part. For instance consider the case of 
passing a callback (delegate) to the RPC system written in c++. How do you keep 
the associated data rooted without causing leaks? You'd need to remember to 
manually add it to the gc roots when the callback object is created and then 
unroot them when it's invoked. So this needs some kind of glue/binding system.

I'm not saying it's impossible or even hard. Just that I've seen such things 
done before and they were non-trivial.

Reply via email to