gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-dev] GC: status report & call for test


From: Eric Hughes
Subject: Re: [Gnash-dev] GC: status report & call for test
Date: Fri, 06 Jul 2007 21:21:51 -0600

At 08:41 AM 7/5/2007, strk wrote:
Users (ActionScript coders) can still change this relationship.
a function's "constructor" member is a pointer to self, but
might be changed to point to something else:

        A = function() {}
        B = function() {}
        A.prototype.constructor = B.prototype.constructor;
        delete A;

I had commented briefly about this situation a while ago, when it was certainly premature then. My proposal to this would be to initialize ".constructor" members with a weak pointer. The assignment in line 3 above would overwrite that weak pointer with an ordinary GC pointer. Thus in the ordinary case, reference counting would destroy a constructor member when its function goes out of scope, but in the general case the GC would catch it.

The reason that this may still be premature is that it presumes a proper managed_ptr class with multiple variants hiding behind it (say, gc_ptr, rc_ptr, weak_ptr) so that this upgrade in capability happens silently at the point of assignment.

Eric





reply via email to

[Prev in Thread] Current Thread [Next in Thread]