Question about garbage collection specification

rsw0x via Digitalmars-d digitalmars-d at puremagic.com
Sat Jun 13 05:28:13 PDT 2015


On Saturday, 13 June 2015 at 12:26:49 UTC, ketmar wrote:
> 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".

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?


More information about the Digitalmars-d mailing list