48 #define GCSTACKROOT_H 1
105 return s_pps->size();
125 unsigned int index = s_pps->size();
128 s_pps->push_back(node);
151 static void reprotect(RObject* node,
unsigned int index);
164 static void unprotect(
unsigned int count = 1);
185 static void visitRoots(GCNode::const_visitor* v);
187 GCStackRootBase(
const GCNode* node)
188 : m_next(s_roots), m_target(node)
193 m_target->incRefCount();
196 GCStackRootBase(
const GCStackRootBase& source)
197 : m_next(s_roots), m_target(source.m_target)
201 m_target->incRefCount();
210 if (m_target && m_target->decRefCount() == 0)
211 m_target->makeMoribund();
215 GCStackRootBase& operator=(
const GCStackRootBase& source)
218 source.m_target->incRefCount();
219 if (m_target && m_target->decRefCount() == 0)
220 m_target->makeMoribund();
221 m_target = source.m_target;
235 if (m_target && m_target->decRefCount() == 0)
236 m_target->makeMoribund();
253 static std::vector<RObject*>* s_pps;
255 static std::vector<std::pair<RObject*, Context*> >* s_pps;
265 static void cleanup()
272 static void initialize();
277 static void seq_error();
315 template <
class T = RObject>
397 return static_cast<T*
>(
const_cast<GCNode*
>(
ptr()));
407 typedef unsigned int PROTECT_INDEX;
540 #endif // GCSTACKROOT_H