Re: Question about garbage collection specification

2015-06-15 Thread deadalnix via Digitalmars-d
On Monday, 15 June 2015 at 12:49:25 UTC, Steven Schveighoffer wrote: On 6/15/15 8:08 AM, Dmitry Olshansky wrote: On 13-Jun-2015 14:32, rsw0x wrote: http://dlang.org/garbage.html Do not take advantage of alignment of pointers to store bit flags in the low order bits: p = cast(void*)(cast(int)

Re: Question about garbage collection specification

2015-06-15 Thread Steven Schveighoffer via Digitalmars-d
On 6/15/15 12:37 PM, "Marc =?UTF-8?B?U2Now7x0eiI=?= " wrote: On Monday, 15 June 2015 at 16:16:28 UTC, Steven Schveighoffer wrote: How can the compiler POSSIBLY know whether a pointer points at GC data in order to make it undefined behavior? It doesn't need to, the undefined behaviour comes fro

Re: Question about garbage collection specification

2015-06-15 Thread via Digitalmars-d
On Monday, 15 June 2015 at 16:16:28 UTC, Steven Schveighoffer wrote: How can the compiler POSSIBLY know whether a pointer points at GC data in order to make it undefined behavior? It doesn't need to, the undefined behaviour comes from the unfulfilled expectations of the GC. For example, a "suf

Re: Question about garbage collection specification

2015-06-15 Thread Steven Schveighoffer via Digitalmars-d
On 6/15/15 11:49 AM, Alex Parrill wrote: On Monday, 15 June 2015 at 15:33:41 UTC, rsw0x wrote: this doesn't make any sense, it's referring to an object p (of void*), not the location of p. It's setting the lsb of p to 1 and claiming it's undefined behavior, when it's clearly not. Unless I misu

Re: Question about garbage collection specification

2015-06-15 Thread Steven Schveighoffer via Digitalmars-d
On 6/15/15 11:18 AM, Dmitry Olshansky wrote: On 15-Jun-2015 15:49, Steven Schveighoffer wrote: On 6/15/15 8:08 AM, Dmitry Olshansky wrote: On 13-Jun-2015 14:32, rsw0x wrote: http://dlang.org/garbage.html Do not take advantage of alignment of pointers to store bit flags in the low order bits:

Re: Question about garbage collection specification

2015-06-15 Thread Alex Parrill via Digitalmars-d
On Monday, 15 June 2015 at 15:33:41 UTC, rsw0x wrote: this doesn't make any sense, it's referring to an object p (of void*), not the location of p. It's setting the lsb of p to 1 and claiming it's undefined behavior, when it's clearly not. Unless I misunderstand it. `p` is assumed to be a

Re: Question about garbage collection specification

2015-06-15 Thread rsw0x via Digitalmars-d
On Monday, 15 June 2015 at 12:08:31 UTC, Dmitry Olshansky wrote: On 13-Jun-2015 14:32, rsw0x wrote: http://dlang.org/garbage.html Do not take advantage of alignment of pointers to store bit flags in the low order bits: p = cast(void*)(cast(int)p | 1); // error: undefined behavior if this re

Re: Question about garbage collection specification

2015-06-15 Thread ketmar via Digitalmars-d
On Mon, 15 Jun 2015 08:01:58 -0400, Steven Schveighoffer wrote: > We can create new types of pointers, remove void * from the language, > and get rid of unions, and yes, *ONLY THEN* we can have a GC that takes > advantage of this. > > These are painful, massively breaking changes. It's not going

Re: Question about garbage collection specification

2015-06-15 Thread Dmitry Olshansky via Digitalmars-d
On 15-Jun-2015 15:49, Steven Schveighoffer wrote: On 6/15/15 8:08 AM, Dmitry Olshansky wrote: On 13-Jun-2015 14:32, rsw0x wrote: http://dlang.org/garbage.html Do not take advantage of alignment of pointers to store bit flags in the low order bits: p = cast(void*)(cast(int)p | 1); // error: un

Re: Question about garbage collection specification

2015-06-15 Thread Steven Schveighoffer via Digitalmars-d
On 6/15/15 8:08 AM, Dmitry Olshansky wrote: On 13-Jun-2015 14:32, rsw0x wrote: http://dlang.org/garbage.html Do not take advantage of alignment of pointers to store bit flags in the low order bits: p = cast(void*)(cast(int)p | 1); // error: undefined behavior if this restriction is actually i

Re: Question about garbage collection specification

2015-06-15 Thread Dmitry Olshansky via Digitalmars-d
On 13-Jun-2015 14:32, rsw0x wrote: http://dlang.org/garbage.html Do not take advantage of alignment of pointers to store bit flags in the low order bits: p = cast(void*)(cast(int)p | 1); // error: undefined behavior if this restriction is actually imposed - why does std.bitmanip.tagged{ClassRe

Re: Question about garbage collection specification

2015-06-15 Thread Steven Schveighoffer via Digitalmars-d
On 6/14/15 8:44 AM, "Marc =?UTF-8?B?U2Now7x0eiI=?= " wrote: On Sunday, 14 June 2015 at 11:36:59 UTC, Paulo Pinto wrote: On Sunday, 14 June 2015 at 11:03:00 UTC, Marc Schütz wrote: As for arbitrary pointer arithmetic being allowed, I guess that's because the language doesn't distinguish between

Re: Question about garbage collection specification

2015-06-15 Thread Steven Schveighoffer via Digitalmars-d
On 6/14/15 7:02 AM, "Marc =?UTF-8?B?U2Now7x0eiI=?= " wrote: On Saturday, 13 June 2015 at 22:07:26 UTC, deadalnix wrote: On Saturday, 13 June 2015 at 11:32:20 UTC, rsw0x wrote: http://dlang.org/garbage.html Do not take advantage of alignment of pointers to store bit flags in the low order bits:

Re: Question about garbage collection specification

2015-06-14 Thread via Digitalmars-d
On Sunday, 14 June 2015 at 11:36:59 UTC, Paulo Pinto wrote: On Sunday, 14 June 2015 at 11:03:00 UTC, Marc Schütz wrote: As for arbitrary pointer arithmetic being allowed, I guess that's because the language doesn't distinguish between GC and non-GC pointers. And note that it is un-@safe anyway.

Re: Question about garbage collection specification

2015-06-14 Thread rsw0x via Digitalmars-d
On Sunday, 14 June 2015 at 11:36:59 UTC, Paulo Pinto wrote: On Sunday, 14 June 2015 at 11:03:00 UTC, Marc Schütz wrote: On Saturday, 13 June 2015 at 22:07:26 UTC, deadalnix wrote: On Saturday, 13 June 2015 at 11:32:20 UTC, rsw0x wrote: http://dlang.org/garbage.html Do not take advantage of al

Re: Question about garbage collection specification

2015-06-14 Thread rsw0x via Digitalmars-d
On Sunday, 14 June 2015 at 11:57:35 UTC, rsw0x wrote: On Sunday, 14 June 2015 at 11:36:59 UTC, Paulo Pinto wrote: On Sunday, 14 June 2015 at 11:03:00 UTC, Marc Schütz wrote: On Saturday, 13 June 2015 at 22:07:26 UTC, deadalnix wrote: On Saturday, 13 June 2015 at 11:32:20 UTC, rsw0x wrote: htt

Re: Question about garbage collection specification

2015-06-14 Thread Paulo Pinto via Digitalmars-d
On Sunday, 14 June 2015 at 11:03:00 UTC, Marc Schütz wrote: On Saturday, 13 June 2015 at 22:07:26 UTC, deadalnix wrote: On Saturday, 13 June 2015 at 11:32:20 UTC, rsw0x wrote: http://dlang.org/garbage.html Do not take advantage of alignment of pointers to store bit flags in the low order bits

Re: Question about garbage collection specification

2015-06-14 Thread via Digitalmars-d
On Saturday, 13 June 2015 at 22:07:26 UTC, deadalnix wrote: On Saturday, 13 June 2015 at 11:32:20 UTC, rsw0x wrote: http://dlang.org/garbage.html Do not take advantage of alignment of pointers to store bit flags in the low order bits: p = cast(void*)(cast(int)p | 1); // error: undefined beha

Re: Question about garbage collection specification

2015-06-13 Thread ketmar via Digitalmars-d
On Sat, 13 Jun 2015 22:09:52 +, deadalnix wrote: > I haven't read something that ridiculous in a while. you're welcome. signature.asc Description: PGP signature

Re: Question about garbage collection specification

2015-06-13 Thread Steven Schveighoffer via Digitalmars-d
On 6/13/15 6:07 PM, deadalnix wrote: On Saturday, 13 June 2015 at 11:32:20 UTC, rsw0x wrote: http://dlang.org/garbage.html Do not take advantage of alignment of pointers to store bit flags in the low order bits: p = cast(void*)(cast(int)p | 1); // error: undefined behavior if this restriction

Re: Question about garbage collection specification

2015-06-13 Thread deadalnix via Digitalmars-d
On Saturday, 13 June 2015 at 12:26:49 UTC, ketmar wrote: 'cause D is not another fashionable scripting language where you have to eat what you got. one can avoid using GC in his code, or intermix GC with other allocators, or rewrite the whole GC or the whole runtime. writing stupid boilerplate

Re: Question about garbage collection specification

2015-06-13 Thread deadalnix via Digitalmars-d
On Saturday, 13 June 2015 at 11:32:20 UTC, rsw0x wrote: http://dlang.org/garbage.html Do not take advantage of alignment of pointers to store bit flags in the low order bits: p = cast(void*)(cast(int)p | 1); // error: undefined behavior if this restriction is actually imposed - why does std

Re: Question about garbage collection specification

2015-06-13 Thread ketmar via Digitalmars-d
On Sat, 13 Jun 2015 12:28:13 +, rsw0x wrote: > There's not even a warning on them that they're violating the garbage > collector specification, don't you think that's a little important? i believe that if one needs to do such things, he is knowledgeable enough to foresee the possible consequ

Re: Question about garbage collection specification

2015-06-13 Thread via Digitalmars-d
On Saturday, 13 June 2015 at 12:28:15 UTC, rsw0x wrote: There's not even a warning on them that they're violating the garbage collector specification, don't you think that's a little important? https://github.com/D-Programming-Language/phobos/pull/3411

Re: Question about garbage collection specification

2015-06-13 Thread rsw0x via Digitalmars-d
On Saturday, 13 June 2015 at 12:26:49 UTC, ketmar wrote: On Sat, 13 Jun 2015 11:32:18 +, rsw0x wrote: http://dlang.org/garbage.html Do not take advantage of alignment of pointers to store bit flags in the low order bits: p = cast(void*)(cast(int)p | 1); // error: undefined behavior if

Re: Question about garbage collection specification

2015-06-13 Thread ketmar via Digitalmars-d
On Sat, 13 Jun 2015 11:32:18 +, rsw0x wrote: > http://dlang.org/garbage.html > > Do not take advantage of alignment of pointers to store bit flags in the > low order bits: > p = cast(void*)(cast(int)p | 1); // error: undefined behavior > > if this restriction is actually imposed - why does

Question about garbage collection specification

2015-06-13 Thread rsw0x via Digitalmars-d
http://dlang.org/garbage.html Do not take advantage of alignment of pointers to store bit flags in the low order bits: p = cast(void*)(cast(int)p | 1); // error: undefined behavior if this restriction is actually imposed - why does std.bitmanip.tagged{ClassRef,Pointer} even exist?