[Article] D's Garbage Collector Problem

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Sat Sep 13 11:06:46 PDT 2014


On Thursday, 11 September 2014 at 16:26:37 UTC, Marco Leise wrote:
> Immutable data structures cannot have pointers changed or set
> to null. Also they can only reference other immutable data.
> This means that they form sort of a big blob that is kept
> alive by one or more pointers to it, but the GC never needs
> to check the immutable pointers inside of it.

GC still should free unreachable parts of that blob.

> Shared/unshared may affect implementations that provide thread
> local GC. E.g. only shared data needs to be handled by a
> global stop the world GC. I'm not sure though.

Can get in a way, when you need a thread-local immutable object.


More information about the Digitalmars-d mailing list