Folks, but mostly strk:

A thought that's been kicking about in my mind for a while finally crystallized, which is an intermediate utility class to write that would ease the transition to GC. If the problem is that reference counts are currently held within object, and in the long run they can't be, then it seems feasible to consider moving them out generically.

Consider instrusive_ptr< something >. First thing is to rename that to something_old. Then use something like the following.

        class something_old ;   // an underlying class

        template< class T >
        class intruded_class
        {
                size_t reference_count ;
        public:
                void intrusive_ptr_add_ref( ... ) ;
                // etc.
        } ;

        class something
                : public intruded_class< something_old >
        {
        public:
                something() ;           // new constructor
        }

After all this, there's now a split between the underlying class, the one that's going to be in GC for the long term, and that class with an explicitly-added reference count, to allow legacy code to continue to function. The magic happens because intruded_class can interact with GC, generically, in ways that individual class would not be considered to.

I have no idea how useful this idea may be to you, but it does address in some way (I'll assume not the right way) one of the problems you mentioned last week.

Eric



_______________________________________________
Gnash-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnash-dev

Reply via email to