Re: VariantPointer

2016-04-30 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 20 April 2016 at 13:41:27 UTC, Nordlöw wrote: https://github.com/nordlow/phobos-next/blob/master/src/variant_pointer.d Moved here: https://github.com/nordlow/phobos-next/blob/master/src/variant_ex.d

Re: VariantPointer

2016-04-21 Thread Lass Safin via Digitalmars-d-learn
On Wednesday, 20 April 2016 at 20:07:31 UTC, Nordlöw wrote: On Wednesday, 20 April 2016 at 16:08:32 UTC, Lass Safin wrote: core.memory.GC.setAttr can set attributes for a block of memory, with which you can set the attribute NO_SCAN, which as it implies, forces that no scan be done in the parti

Re: VariantPointer

2016-04-20 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 20 April 2016 at 18:40:58 UTC, Alex Parrill wrote: As for the GC, you're probably out of luck. Adding a global mask option is unlikely to work well if multiple libraries use it. So we need an optional block-local mask then! ;)

Re: VariantPointer

2016-04-20 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 20 April 2016 at 16:08:32 UTC, Lass Safin wrote: core.memory.GC.setAttr can set attributes for a block of memory, with which you can set the attribute NO_SCAN, which as it implies, forces that no scan be done in the particular block of memory. This can be used to insure that the G

Re: VariantPointer

2016-04-20 Thread Alex Parrill via Digitalmars-d-learn
On Wednesday, 20 April 2016 at 13:41:27 UTC, Nordlöw wrote: At https://github.com/nordlow/phobos-next/blob/master/src/variant_pointer.d I've implemented a pointer-only version of Variant called VariantPointer. I plan to use it to construct light-weight polymorphism in trie containers

Re: VariantPointer

2016-04-20 Thread Lass Safin via Digitalmars-d-learn
On Wednesday, 20 April 2016 at 14:36:54 UTC, Nordlöw wrote: On Wednesday, 20 April 2016 at 13:41:27 UTC, Nordlöw wrote: At https://github.com/nordlow/phobos-next/blob/master/src/variant_pointer.d Further: What to do with fact that the GC will fail to scan VariantPointers? Can the GC be tw

Re: VariantPointer

2016-04-20 Thread Lass Safin via Digitalmars-d-learn
On Wednesday, 20 April 2016 at 13:41:27 UTC, Nordlöw wrote: At https://github.com/nordlow/phobos-next/blob/master/src/variant_pointer.d I've implemented a pointer-only version of Variant called VariantPointer. [...] It safe to assume that `typeBits` most significant bits of a pointer

Re: VariantPointer

2016-04-20 Thread Nordlöw via Digitalmars-d-learn
On Wednesday, 20 April 2016 at 13:41:27 UTC, Nordlöw wrote: At https://github.com/nordlow/phobos-next/blob/master/src/variant_pointer.d Further: What to do with fact that the GC will fail to scan VariantPointers? Can the GC be tweaked to mask out the type bits before scanning?

VariantPointer

2016-04-20 Thread Nordlöw via Digitalmars-d-learn
At https://github.com/nordlow/phobos-next/blob/master/src/variant_pointer.d I've implemented a pointer-only version of Variant called VariantPointer. I plan to use it to construct light-weight polymorphism in trie containers for D I'm currently writing. VariantPointer uses the