Gnash
0.8.10
|
Collectable resource. More...
#include <GC.h>
Public Member Functions | |
GcResource (GC &gc) | |
Create a Garbage-collected resource associated with a GC. | |
void | setReachable () const |
Mark this resource as being reachable. | |
bool | isReachable () const |
Return true if this object is marked as reachable. | |
void | clearReachable () const |
Clear the reachable flag. | |
Protected Member Functions | |
virtual void | markReachableResources () const |
Scan all GC resources reachable by this instance. | |
virtual | ~GcResource () |
Delete this resource. | |
Friends | |
class | GC |
Collectable resource.
Instances of this class can be managed by a GC object.
gnash::GcResource::GcResource | ( | GC & | gc | ) | [inline] |
Create a Garbage-collected resource associated with a GC.
gc | The GC to register the resource with. |
References gnash::GC::addCollectable().
virtual gnash::GcResource::~GcResource | ( | ) | [inline, protected, virtual] |
Delete this resource.
This is protected to allow subclassing, but ideally it sould be private, so only the GC is allowed to delete us.
void gnash::GcResource::clearReachable | ( | ) | const [inline] |
Clear the reachable flag.
bool gnash::GcResource::isReachable | ( | ) | const [inline] |
Return true if this object is marked as reachable.
virtual void gnash::GcResource::markReachableResources | ( | ) | const [inline, protected, virtual] |
Scan all GC resources reachable by this instance.
This function is invoked everytime this object switches from unreachable to reachable, and is used to recursively mark all contained resources as reachable.
See setReachable(), which is the function to invoke against all reachable methods.
Feel free to assert(_reachable) in your implementation.
The default implementation doesn't mark anything.
Reimplemented in gnash::DisplayObject, gnash::as_object, gnash::Function, and gnash::Global_as.
References assert, _, and gnash::typeName().
Referenced by setReachable().
void gnash::GcResource::setReachable | ( | ) | const [inline] |
Mark this resource as being reachable.
This can trigger further marking of all resources reachable by this object. If the object wasn't reachable before, this call triggers scan of all contained objects too.
References _, gnash::typeName(), and markReachableResources().
Referenced by gnash::as_environment::markReachableResources(), gnash::as_object::markReachableResources(), gnash::Trigger::setReachable(), gnash::as_value::setReachable(), gnash::BitmapData_as::setReachable(), gnash::Button::markOwnResources(), gnash::CallFrame::markReachableResources(), gnash::CharacterProxy::setReachable(), gnash::DisplayObject::markReachableResources(), gnash::DragState::markReachableResources(), gnash::ExecutableCode::markReachableResources(), gnash::DelayedFunctionCall::setReachable(), gnash::Function::markReachableResources(), gnash::Global_as::markReachableResources(), gnash::abc::Machine::markReachableResources(), gnash::MouseButtonState::markReachableResources(), gnash::movie_root::markReachableResources(), gnash::movie_root::LoadCallback::setReachable(), gnash::MovieClip::markOwnResources(), gnash::NetConnection_as::markReachableResources(), gnash::NetStream_as::markReachableResources(), gnash::GetterSetter::UserDefinedGetterSetter::markReachableResources(), gnash::ActiveRelay::setReachable(), gnash::Timer::markReachableResources(), gnash::VM::markReachableResources(), and gnash::XMLNode_as::setReachable().
friend class GC [friend] |