digitalmars.D - Pointer top 16 bits use
- Nicholas Wilson (7/7) May 06 2016 In Dicebot's DConf talk he mentioned that it is possible to use
- Benjamin Thaut (6/13) May 06 2016 The problem with this is, that its not future proof. Once the top
- =?UTF-8?Q?Ali_=c3=87ehreli?= (3/4) May 07 2016 That was deadalnix. :)
- Nicholas Wilson (2/6) May 07 2016 Touché.
- Marco Leise (11/20) May 07 2016 Too many d's for the day. :) I agree with Benjamin, that we
- deadalnix (6/24) May 08 2016 You could have allocated an array, so that's a problem, you can
- Claude (6/13) May 09 2016 I would not rely on it *at all* actually, even now. I do not
In Dicebot's DConf talk he mentioned that it is possible to use the top 16 bits for tagging pointers and the associated risks. Regarding the GC not seeing a pointer if the top 16 bits are used, whats to stop us from changing the GC to (or adding an option to) ignore those bits when checking? I imagine that it would cause a lot more false pointers, but when we get precise GC that problem would go away.
May 06 2016
On Saturday, 7 May 2016 at 06:08:01 UTC, Nicholas Wilson wrote:In Dicebot's DConf talk he mentioned that it is possible to use the top 16 bits for tagging pointers and the associated risks. Regarding the GC not seeing a pointer if the top 16 bits are used, whats to stop us from changing the GC to (or adding an option to) ignore those bits when checking? I imagine that it would cause a lot more false pointers, but when we get precise GC that problem would go away.The problem with this is, that its not future proof. Once the top 16-bits of a pointer get used D programs will suddenly stop working. So i think we shouldn't support that officially. If you really want to do that you can simply hack the scan routine of the gc in druntime yourself and ship with the hacked version.
May 06 2016
On 05/06/2016 11:08 PM, Nicholas Wilson wrote:In Dicebot's DConf talkThat was deadalnix. :) Ali
May 07 2016
On Saturday, 7 May 2016 at 09:01:11 UTC, Ali Çehreli wrote:On 05/06/2016 11:08 PM, Nicholas Wilson wrote:Touché.In Dicebot's DConf talkThat was deadalnix. :) Ali
May 07 2016
Am Sat, 07 May 2016 12:02:07 +0000 schrieb Nicholas Wilson <iamthewilsonator hotmail.com>:On Saturday, 7 May 2016 at 09:01:11 UTC, Ali =C3=87ehreli wrote:Too many d's for the day. :) I agree with Benjamin, that we can't rely on the 16-bits being reserved forever. I have a question about the lower 3 bits OTOH. The minimal GC allocation size is >=3D 8 bytes, right? I.e. if we set the lower 3 bits to 0b111, and the pointer points to a 4 byte structure, it will still be recognized as an internal pointer due to the overallocation. --=20 MarcoOn 05/06/2016 11:08 PM, Nicholas Wilson wrote: =20=20 Touch=C3=A9.In Dicebot's DConf talk =20That was deadalnix. :) Ali =20
May 07 2016
On Saturday, 7 May 2016 at 12:32:53 UTC, Marco Leise wrote:Am Sat, 07 May 2016 12:02:07 +0000 schrieb Nicholas Wilson <iamthewilsonator hotmail.com>:You could have allocated an array, so that's a problem, you can only use 2 bits. taggedPointer will check for this at compile time. But, yes, LSB are safe to use is you wrap it properly because it will be seen as an interior pointer.On Saturday, 7 May 2016 at 09:01:11 UTC, Ali Çehreli wrote:Too many d's for the day. :) I agree with Benjamin, that we can't rely on the 16-bits being reserved forever. I have a question about the lower 3 bits OTOH. The minimal GC allocation size is >= 8 bytes, right? I.e. if we set the lower 3 bits to 0b111, and the pointer points to a 4 byte structure, it will still be recognized as an internal pointer due to the overallocation.On 05/06/2016 11:08 PM, Nicholas Wilson wrote:Touché.In Dicebot's DConf talkThat was deadalnix. :) Ali
May 08 2016
On Saturday, 7 May 2016 at 06:08:01 UTC, Nicholas Wilson wrote:In Dicebot's DConf talk he mentioned that it is possible to use the top 16 bits for tagging pointers and the associated risks. Regarding the GC not seeing a pointer if the top 16 bits are used, whats to stop us from changing the GC to (or adding an option to) ignore those bits when checking? I imagine that it would cause a lot more false pointers, but when we get precise GC that problem would go away.I would not rely on it *at all* actually, even now. I do not think it would make D portable to every system (let's not only consider x86 architecture). We don't know how a system would choose to map physical memory and hardware devices to virtual memory.
May 09 2016