Commit e59a07dd authored by eric@webkit.org's avatar eric@webkit.org
Browse files

2009-10-01 Yongjun Zhang <yongjun.zhang@nokia.com>

        Reviewed by Darin Adler.

        https://bugs.webkit.org/show_bug.cgi?id=29187

        Don't inline ~ListRefPtr() to work around winscw compiler forward declaration
        bug regarding templated classes.

        The compiler bug is reported at:
        https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812

        The change will be reverted when the above bug is fixed in winscw compiler.

        * wtf/ListRefPtr.h:
        (WTF::::~ListRefPtr):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@48988 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent b539bdb8
2009-10-01 Yongjun Zhang <yongjun.zhang@nokia.com>
Reviewed by Darin Adler.
https://bugs.webkit.org/show_bug.cgi?id=29187
Don't inline ~ListRefPtr() to work around winscw compiler forward declaration
bug regarding templated classes.
The compiler bug is reported at:
https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812
The change will be reverted when the above bug is fixed in winscw compiler.
* wtf/ListRefPtr.h:
(WTF::::~ListRefPtr):
2009-10-01 Zoltan Horvath <zoltan@webkit.org>
Reviewed by Simon Hausmann.
......
......@@ -34,13 +34,8 @@ namespace WTF {
ListRefPtr(const RefPtr<T>& o) : RefPtr<T>(o) {}
// see comment in PassRefPtr.h for why this takes const reference
template <typename U> ListRefPtr(const PassRefPtr<U>& o) : RefPtr<T>(o) {}
~ListRefPtr()
{
RefPtr<T> reaper = this->release();
while (reaper && reaper->hasOneRef())
reaper = reaper->releaseNext(); // implicitly protects reaper->next, then derefs reaper
}
~ListRefPtr();
ListRefPtr& operator=(T* optr) { RefPtr<T>::operator=(optr); return *this; }
ListRefPtr& operator=(const RefPtr<T>& o) { RefPtr<T>::operator=(o); return *this; }
......@@ -49,6 +44,20 @@ namespace WTF {
template <typename U> ListRefPtr& operator=(const PassRefPtr<U>& o) { RefPtr<T>::operator=(o); return *this; }
};
// Remove inline for winscw compiler to prevent the compiler agressively resolving
// T::ref() in RefPtr<T>'s copy constructor. The bug is reported at:
// https://xdabug001.ext.nokia.com/bugzilla/show_bug.cgi?id=9812.
template <typename T>
#if !COMPILER(WINSCW)
inline
#endif
ListRefPtr<T>::~ListRefPtr()
{
RefPtr<T> reaper = this->release();
while (reaper && reaper->hasOneRef())
reaper = reaper->releaseNext(); // implicitly protects reaper->next, then derefs reaper
}
template <typename T> inline T* getPtr(const ListRefPtr<T>& p)
{
return p.get();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment