Re: Garbage collected pointers?

2018-03-02 Thread Gary Willoughby via Digitalmars-d-learn
On Friday, 2 March 2018 at 08:44:53 UTC, Gary Willoughby wrote: It would be interesting to test whether those methods handle these scenarios. Yeah, it doesn't work. https://dpaste.dzfl.pl/55116efd0c9c

Re: Garbage collected pointers?

2018-03-02 Thread Gary Willoughby via Digitalmars-d-learn
On Thursday, 1 March 2018 at 12:20:08 UTC, Steven Schveighoffer wrote: On 3/1/18 7:05 AM, Gary Willoughby wrote: On Thursday, 1 March 2018 at 10:10:27 UTC, John Burton wrote: My question is how do I tell if a pointer is "garbage collected" or not? You could try `GC.addrOf()` or `GC.query()`

Re: Garbage collected pointers?

2018-03-01 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, March 01, 2018 15:53:08 Steven Schveighoffer via Digitalmars-d- learn wrote: > On 3/1/18 3:33 PM, H. S. Teoh wrote: > > Won't a precise GC scanning for pointers to aligned objects want to skip > > values that can't be an aligned pointer? Though in D's case, being > > required to be

Re: Garbage collected pointers?

2018-03-01 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/1/18 3:33 PM, H. S. Teoh wrote: On Thu, Mar 01, 2018 at 02:52:26PM -0500, Steven Schveighoffer via Digitalmars-d-learn wrote: [...] There are a few in there, which I think are over-the-top. Such as "don't cast a pointer to a non-pointer", [...] Isn't that necessary for a precise GC?

Re: Garbage collected pointers?

2018-03-01 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Mar 01, 2018 at 02:52:26PM -0500, Steven Schveighoffer via Digitalmars-d-learn wrote: [...] > There are a few in there, which I think are over-the-top. Such as > "don't cast a pointer to a non-pointer", [...] Isn't that necessary for a precise GC? Also, AIUI the current GC already does

Re: Garbage collected pointers?

2018-03-01 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, March 01, 2018 14:52:26 Steven Schveighoffer via Digitalmars-d- learn wrote: > On 3/1/18 2:04 PM, Jonathan M Davis wrote: > > On Thursday, March 01, 2018 10:55:34 Steven Schveighoffer via > > Digitalmars-d-> > > learn wrote: > >> It should really say that it's up to the GC

Re: Garbage collected pointers?

2018-03-01 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/1/18 2:04 PM, Jonathan M Davis wrote: On Thursday, March 01, 2018 10:55:34 Steven Schveighoffer via Digitalmars-d- learn wrote: It should really say that it's up to the GC implementation whether it's UB or not. Well, that arguably makes it UB in general then, because it can't be relied

Re: Garbage collected pointers?

2018-03-01 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, March 01, 2018 10:55:34 Steven Schveighoffer via Digitalmars-d- learn wrote: > It should really say that it's up to the GC implementation whether it's UB > or not. Well, that arguably makes it UB in general then, because it can't be relied on. By putting restrictions on the GC in

Re: Garbage collected pointers?

2018-03-01 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/1/18 10:35 AM, John Burton wrote: On Thursday, 1 March 2018 at 12:20:08 UTC, Steven Schveighoffer wrote: On 3/1/18 7:05 AM, Gary Willoughby wrote: On Thursday, 1 March 2018 at 10:10:27 UTC, John Burton wrote: My question is how do I tell if a pointer is "garbage collected" or not? You

Re: Garbage collected pointers?

2018-03-01 Thread John Burton via Digitalmars-d-learn
On Thursday, 1 March 2018 at 12:20:08 UTC, Steven Schveighoffer wrote: On 3/1/18 7:05 AM, Gary Willoughby wrote: On Thursday, 1 March 2018 at 10:10:27 UTC, John Burton wrote: My question is how do I tell if a pointer is "garbage collected" or not? You could try `GC.addrOf()` or `GC.query()`

Re: Garbage collected pointers?

2018-03-01 Thread Steven Schveighoffer via Digitalmars-d-learn
On 3/1/18 7:05 AM, Gary Willoughby wrote: On Thursday, 1 March 2018 at 10:10:27 UTC, John Burton wrote: My question is how do I tell if a pointer is "garbage collected" or not? You could try `GC.addrOf()` or `GC.query()` in core.memory. I was going to say this, but then I realized, it's not

Re: Garbage collected pointers?

2018-03-01 Thread Gary Willoughby via Digitalmars-d-learn
On Thursday, 1 March 2018 at 10:10:27 UTC, John Burton wrote: My question is how do I tell if a pointer is "garbage collected" or not? You could try `GC.addrOf()` or `GC.query()` in core.memory.

Re: Garbage collected pointers?

2018-03-01 Thread Dmitry Olshansky via Digitalmars-d-learn
On Thursday, 1 March 2018 at 10:10:27 UTC, John Burton wrote: In the language spec here :- https://dlang.org/spec/garbage.html#pointers_and_gc It refers to a distinction between pointers to garbage collected memory and pointers that are not. In particular it says that with a non garbage

Re: Garbage collected pointers?

2018-03-01 Thread rikki cattermole via Digitalmars-d-learn
On 01/03/2018 11:10 PM, John Burton wrote: In the language spec here :- https://dlang.org/spec/garbage.html#pointers_and_gc It refers to a distinction between pointers to garbage collected memory and pointers that are not. In particular it says that with a non garbage collected pointer you

Garbage collected pointers?

2018-03-01 Thread John Burton via Digitalmars-d-learn
In the language spec here :- https://dlang.org/spec/garbage.html#pointers_and_gc It refers to a distinction between pointers to garbage collected memory and pointers that are not. In particular it says that with a non garbage collected pointer you can do anything that is legal in C but with