April 20, 2009 C APIs and D Classes | ||||
---|---|---|---|---|
| ||||
Hello Save and retrieve a class pointer in a C API is valid? or, the GC will move the class memory and the stored pointer become invalid? Thanks |
April 20, 2009 Re: C APIs and D Classes | ||||
---|---|---|---|---|
| ||||
Posted in reply to Fractal | Fractal wrote:
> Hello
>
> Save and retrieve a class pointer in a C API is valid? or, the GC
> will move the class memory and the stored pointer become invalid?
>
> Thanks
Greetings.
This newsgroup is deprecated. It is suggested you use digitalmars.D or digitalmars.D.learn instaed.
As for your question, D does not have a moving garbage collector, so as long as the instance is alive, its location does not change. So yes, you can allow C functions to store your D pointers.
--
Simen
|
Copyright © 1999-2021 by the D Language Foundation