One awesome GC feature we will use in Mir!

9il ilyayaroshenko at gmail.com
Tue Sep 18 17:21:17 UTC 2018


On Tuesday, 18 September 2018 at 16:29:30 UTC, Vladimir Panteleev 
wrote:
> On Tuesday, 18 September 2018 at 16:15:45 UTC, 9il wrote:
>> If a user allocates new double[], GC will scan whole array 
>> memory, because it is assumed that user may reuse this memory 
>> for types that have references.
>
> Are you sure? That doesn't sound right.
>
> I know this is the case for void[] - even though you can't put 
> pointers in it, it could hold "anything", so the GC strays on 
> the safe side and assumes it has pointers.
>
> There was (is?) a problem with e.g. std.file.read("a") ~ 
> std.file.read("b") - even though read marked the memory as not 
> containing pointers, the result of concatenation is a new 
> void[], which the GC thinks might contain pointers.

Thanks! Is there is information about how GC set flags for `new` 
on the site?


More information about the Digitalmars-d mailing list