[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-dev] intrusive_ptr and GC
From: |
Eric Hughes |
Subject: |
[Gnash-dev] intrusive_ptr and GC |
Date: |
Tue, 10 Jul 2007 07:19:00 -0600 |
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] intrusive_ptr and GC,
Eric Hughes <=