gnash-commit
[Top][All Lists]
Advanced

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

Re: [Gnash-commit] gnash ChangeLog server/asobj/Boolean.cpp server...


From: Sandro Santilli
Subject: Re: [Gnash-commit] gnash ChangeLog server/asobj/Boolean.cpp server...
Date: Wed, 1 Aug 2007 18:01:51 +0200

On Wed, Aug 01, 2007 at 03:56:54PM +0000, Sandro Santilli wrote:
> CVSROOT:      /sources/gnash
> Module name:  gnash
> Changes by:   Sandro Santilli <strk>  07/08/01 15:56:54
> 
> Modified files:
>       .              : ChangeLog 
>       server/asobj   : Boolean.cpp Number.cpp string.cpp 
>       server/vm      : VM.cpp VM.h 
> 
> Log message:
>               * server/asobj/: Boolean.cpp, Number.cpp, string.cpp:
>                 register static constructors and prototypes with the VM.
>               * server/vm/VM.{cpp,h}: Add support for registering
>                 arbitrary as_object for reachability. Intended to
>                 be used whenever a static as_object pointer is allocated.

This commit prepared a solution for the 'static GcResources' problem.

The problem is that all built-in classes use a static pointer for allocating
the constructors and it's prototype. These static pointers are not guaranteed
to be reachable during a run. For example, if a user override the global
String constructor, next GC run will free it, so the static pointer will
end up pointing to released memory.

This is generally fine as no action could try to use that object anymore.
But there are a few exception.

In the Number,Boolean and String object case, the exception is that
as_value::to_object() would try to construct a Boolean , String or Number
instance if the primitive value type is a boolean,string or number
respectively. This results in accessing the constructor and prototype
past the release of them.

Now, this patch registers the Boolean,Number and String static constructor
and prototype objects with the VM, in a generic vector of GcReousrces
to keep alive.

--strk;




reply via email to

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