X-Git-Url: https://git.saurik.com/apple/javascriptcore.git/blobdiff_plain/ba379fdc102753d6be2c4d937058fe40257329fe..f9bf01c6616d5ddcf65b13b33cedf9e387ff7a63:/wtf/ListRefPtr.h diff --git a/wtf/ListRefPtr.h b/wtf/ListRefPtr.h index 9f9a354..8bf6447 100644 --- a/wtf/ListRefPtr.h +++ b/wtf/ListRefPtr.h @@ -34,13 +34,8 @@ namespace WTF { ListRefPtr(const RefPtr& o) : RefPtr(o) {} // see comment in PassRefPtr.h for why this takes const reference template ListRefPtr(const PassRefPtr& o) : RefPtr(o) {} - - ~ListRefPtr() - { - RefPtr reaper = this->release(); - while (reaper && reaper->hasOneRef()) - reaper = reaper->releaseNext(); // implicitly protects reaper->next, then derefs reaper - } + + ~ListRefPtr(); ListRefPtr& operator=(T* optr) { RefPtr::operator=(optr); return *this; } ListRefPtr& operator=(const RefPtr& o) { RefPtr::operator=(o); return *this; } @@ -49,6 +44,20 @@ namespace WTF { template ListRefPtr& operator=(const PassRefPtr& o) { RefPtr::operator=(o); return *this; } }; + // Remove inline for winscw compiler to prevent the compiler agressively resolving + // T::ref() in RefPtr's copy constructor. The bug is reported at: + // https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812. + template +#if !COMPILER(WINSCW) + inline +#endif + ListRefPtr::~ListRefPtr() + { + RefPtr reaper = this->release(); + while (reaper && reaper->hasOneRef()) + reaper = reaper->releaseNext(); // implicitly protects reaper->next, then derefs reaper + } + template inline T* getPtr(const ListRefPtr& p) { return p.get();