13-Jan-2014 13:20, Rainer Schuetze пишет:
On Sunday, 12 January 2014 at 10:40:50 UTC, Benjamin Thaut wrote:
Am 12.01.2014 11:27, schrieb Rainer Schuetze:

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.


Could you give an example which part of the language would not be
doable with a moving collector? The only thing that comes to my mind
is unions and that problem can be solved by allowing the user to
specify manual scanning functions for structs or classes containing
unions.

Maybe I'm too pessimistic ;-) I guess moving in general could be ok, I
was thinking about segregating heaps by type (shared/immutable/mutable)
and moving data between them adds restrictions. I'd like to be proven
wrong.

Some thoughts regarding a moving collector:


Having to explicitely pin every pointer passed to C functions would be
very expensive.

How would it be expensive? I don't see a need to do anything to "pin" a memory block, at the time of scanning there will be a potential pointer to it (in the stack space of C function or registers).

--
Dmitry Olshansky

Reply via email to