12-Jan-2014 14:27, Rainer Schuetze пишет:
On 11.01.2014 22:20, Benjamin Thaut wrote:
Am 11.01.2014 21:44, schrieb Andrei Alexandrescu:

Well as far as my understanding of GCs goes, you have two options:

1) Impercise pointer discovery => limiting yourself to a mark & sweep
2) Percise pointer disccovery => option to use a semi space GC in
combination with a mark & sweep and generations, which allows for
superior handling of short lived allocations (which is the biggest
problem of D's current GC).

Also without percise pointer discovery you will never be able to move
objects from one heap into another. This would be especially a problem
for the immutable heap, because you might want to allocate all strings
on the thread local heap until you discover that you actually need them
to be shared between threads. You might also need to move objects into
antoher heap whenever a casts happens or global variable is assigned.

Kind Regards
Benjamin Thaut

I think a moving collector is currently not feasible without restricting
the language a lot, probably similar to safe D and more. I'm not sure we
want that in general.

I might be ignorant but why can't we make "mostly-moving" collector?

For that we discern precise pointers (with typeinfo) and conservative (such as potential pointers in registers/stack). Then any block pointed to by a least one conservative pointer is pinned, others though can be moved freely since all of the pointers are known.


--
Dmitry Olshansky

Reply via email to