Thread overview
windows DLL
Mar 25, 2005
bero
Mar 25, 2005
Chris Sauls
Mar 25, 2005
bero
March 25, 2005
There are windows dll example in dmd/samples/d/mydll.
It looks each dll has own gc.

If instance allocated in main program points instance allocated in dll
or vice velsa, whats happen?
as main GC, instance pointed from dll gc looks garbage, so it will freed.

One of the safety way is, sepalete gc (or whole phobos) as dll, and both program and dll link it to use only one gc.

any suggestion?

BERO
March 25, 2005
Walter came up with an interesting new method of working with DLL's in D
not that long ago.  Check out:
http://www.digitalmars.com/d/dll.html

In particular look at the section "D code calling D code in DLLs" to see
 the use of std.gc.setGCHandle(), std.gc.getGCHandle(), and
std.gc.endGCHandle() functions.

-- Chris Sauls

bero wrote:
> There are windows dll example in dmd/samples/d/mydll.
> It looks each dll has own gc.
> 
> If instance allocated in main program points instance allocated in dll
> or vice velsa, whats happen?
> as main GC, instance pointed from dll gc looks garbage, so it will freed.
> 
> One of the safety way is, sepalete gc (or whole phobos) as dll, and both program and dll link it to use only one gc.
> 
> any suggestion?
> 
> BERO
March 25, 2005
Chris Sauls wrote:
> Walter came up with an interesting new method of working with DLL's in D
> not that long ago.  Check out:
> http://www.digitalmars.com/d/dll.html
> 
thx