Question about garbage collection specification

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 13 05:26:49 PDT 2015


On Sat, 13 Jun 2015 11:32:18 +0000, 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{ClassRef,Pointer} even exist?

'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 code for tagged pointers and nan boxing is simply 
tedious, it belongs to library.

in other words: you can use `DirEntries` and `remove` to kill all files 
in your home directory, but it's not the only use for that functions, so 
they should not be removed from Phobos as "useless" or "dangerous".
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20150613/b05abedd/attachment.sig>


More information about the Digitalmars-d mailing list