From: Leopold Toetsch <[EMAIL PROTECTED]> Date: Mon, 25 Apr 2005 17:41:49 +0200
Nicholas Clark <[EMAIL PROTECTED]> wrote: > . . . > Others relate to "this PMC is going away". And as morph involves changing > the internal memory layout of a PMC without it actually going away, only the > first set ought to run. No, not really. If the PMC memory physically goes away or not doesn't matter. C<morph> is basically: destroy_PMC_now_but_keep_storage Px reuse_storage_for_new Px, type But it isn't known, if the last reference to that PMC is reused or not. If it is the last reference then the finalizer has to run, else not. As we don't have reference counts, an assign to an object with finalizers ougth to trigger a GC run, IMHO. Is that really necessary? After a PMC has been morphed, it seems to me that there is no possible way for anyone to reference whatever it was in its previous life. So the process of morphing ought to be able to do any finalization of the old PMC that the GC would do, since the old PMC is really and truly going away forever. In fact, morph *must* finalize; since we still have a pointer to the PMC being morphed, the GC won't even know that it needs it. True? -- Bob Rogers