Re: Is there an object on given memory address?

2015-02-12 Thread via Digitalmars-d-learn
On Thursday, 12 February 2015 at 16:56:24 UTC, Marc Schütz wrote: Whoaa, that's just horrible! *shudder* I know, but it works.

Re: Is there an object on given memory address?

2015-02-12 Thread via Digitalmars-d-learn
On Thursday, 12 February 2015 at 16:27:21 UTC, Ola Fosheim Grøstad wrote: On Thursday, 12 February 2015 at 15:53:07 UTC, Marc Schütz wrote: On Thursday, 12 February 2015 at 10:16:49 UTC, Ola Fosheim Grøstad wrote: then query the GC wether the memory is still allocated. This is racy, though. S

Re: Is there an object on given memory address?

2015-02-12 Thread via Digitalmars-d-learn
On Thursday, 12 February 2015 at 15:53:07 UTC, Marc Schütz wrote: On Thursday, 12 February 2015 at 10:16:49 UTC, Ola Fosheim Grøstad wrote: then query the GC wether the memory is still allocated. This is racy, though. Someone (or the GC) could have freed the object in the meantime, and a new

Re: Is there an object on given memory address?

2015-02-12 Thread Baz via Digitalmars-d-learn
On Thursday, 12 February 2015 at 11:14:05 UTC, tcak wrote: Or send a hash of the object along with the memory address, then query the GC wether the memory is still allocated. This part sounds interesnting. How does that GC querying thing works exactly? std [doc][1] is your friend but if you

Re: Is there an object on given memory address?

2015-02-12 Thread via Digitalmars-d-learn
On Thursday, 12 February 2015 at 10:16:49 UTC, Ola Fosheim Grøstad wrote: then query the GC wether the memory is still allocated. This is racy, though. Someone (or the GC) could have freed the object in the meantime, and a new object of potentially different type could have taken its place. Y

Re: Is there an object on given memory address?

2015-02-12 Thread tcak via Digitalmars-d-learn
Or send a hash of the object along with the memory address, then query the GC wether the memory is still allocated. This part sounds interesnting. How does that GC querying thing works exactly?

Re: Is there an object on given memory address?

2015-02-12 Thread via Digitalmars-d-learn
On Thursday, 12 February 2015 at 10:04:29 UTC, tcak wrote: BTW, I have already got the address of object into a "size_t" type variable and sent it. That is not the problem part. How reliable do you want? You would have to either "pin the object" by registering a root to it to prevent it from b

Re: Is there an object on given memory address?

2015-02-12 Thread tcak via Digitalmars-d-learn
On Thursday, 12 February 2015 at 10:03:18 UTC, tcak wrote: Is there any "reliable" way to determine whether there is a certain type of object in memory at a given address? I am going to send the memory address of an object to another program over pipes. Then after a while, other program will s

Is there an object on given memory address?

2015-02-12 Thread tcak via Digitalmars-d-learn
Is there any "reliable" way to determine whether there is a certain type of object in memory at a given address? I am going to send the memory address of an object to another program over pipes. Then after a while, other program will send that memory address, and main program will try to addre