One awesome GC feature we will use in Mir!

Vladimir Panteleev thecybershadow.lists at gmail.com
Tue Sep 18 17:41:59 UTC 2018


On Tuesday, 18 September 2018 at 17:21:17 UTC, 9il wrote:
> Thanks! Is there is information about how GC set flags for 
> `new` on the site?

I think it's something like this: The compiler lowers `new T[]` 
to _d_newarrayT or _d_newarrayiT [1]. These functions get a 
TypeInfo as a parameter. The actual TypeInfo object is generated 
by the compiler [2]. __arrayAlloc (called by _d_newarray*) then 
sets BlkAttr.NO_SCAN depending on what's in TypeInfo.flags. [3]

[1]: 
https://github.com/dlang/druntime/blob/542b680f2c2e09e7f4b494898437c61216583fa5/src/rt/lifetime.d#L966-L1014
[2]: 
https://github.com/dlang/dmd/blob/3adcc9e4a0813d26725bb3c9e747ef8d4a2a8296/src/dmd/typinf.d#L35
[3]: 
https://github.com/dlang/druntime/blob/542b680f2c2e09e7f4b494898437c61216583fa5/src/rt/lifetime.d#L425



More information about the Digitalmars-d mailing list