Ticket #4053: fixtrace.patch
File fixtrace.patch, 1.0 KB (added by , 8 years ago) |
---|
-
source/scriptinterface/third_party/ObjectToIDMap.h
class ObjectIdCache 38 38 39 39 public: 40 40 ObjectIdCache(shared_ptr<ScriptRuntime> rt) 41 41 : table_(nullptr), m_rt(rt) 42 42 { 43 JS_AddExtraGCRootsTracer(m_rt->m_rt, ObjectIdCache::Trace, this);44 43 } 45 44 46 45 ~ObjectIdCache() 47 46 { 48 47 if (table_) { 49 48 m_rt->AddDeferredFinalizationObject(std::shared_ptr<void>((void*)table_, DeleteObjectIDTable)); 50 49 table_ = nullptr; 50 JS_RemoveExtraGCRootsTracer(m_rt->m_rt, ObjectIdCache::Trace, this); 51 51 } 52 53 JS_RemoveExtraGCRootsTracer(m_rt->m_rt, ObjectIdCache::Trace, this);54 52 } 55 53 56 54 bool init() 57 55 { 58 56 MOZ_ASSERT(!table_); 59 57 table_ = new ObjectIdTable(js::SystemAllocPolicy()); 58 JS_AddExtraGCRootsTracer(m_rt->m_rt, ObjectIdCache::Trace, this); 60 59 return table_ && table_->init(32); 61 60 } 62 61 63 62 void trace(JSTracer *trc) 64 63 {