Thread overview | |||||
---|---|---|---|---|---|
|
March 25, 2005 windows DLL | ||||
---|---|---|---|---|
| ||||
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 Re: windows DLL | ||||
---|---|---|---|---|
| ||||
Posted in reply to bero | 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 Re: windows DLL | ||||
---|---|---|---|---|
| ||||
Posted in reply to Chris Sauls | 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
|
Copyright © 1999-2021 by the D Language Foundation