--- Comment #13 from nfx...@gmail.com 2010-08-12 07:10:27 PDT ---
(In reply to comment #11)
> This is an interesting idea, but I see two reasons it'll not work fro D.
> D doesn't emit special code notifying the GC when assigning to a pointer, so
> the GC would have to do a full scan again after a collection just to check if
> someone resurrected a memory block.
This isn't so much of a problem if you assume objects with finalizers are rare.
They can be collected in the next GC cycle.
> The second reason is the D2 multithreading model. The GC might run on a
> different thread. If you resurrect a non-shared object, that object won't live
> on the same thread anymore but might continue to reference non-shared memory
> from other threads. This is in violation of the thread-safe type system.
Good point. By definition, if the object is not shared(), the finalizer (or
anything) must not run on a different thread. It doesn't matter if you access
references or not. I wonder how D2 can have finalizers at all with this.
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------