One awesome GC feature we will use in Mir!

Vladimir Panteleev thecybershadow.lists at gmail.com
Tue Sep 18 16:29:30 UTC 2018


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.



More information about the Digitalmars-d mailing list