inlining the work of |StartAssigment| reduces |nsCOMPtr| overhead on windows.

git-svn-id: svn://10.0.0.236/trunk@24870 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
scc%netscape.com 1999-03-23 20:35:49 +00:00
parent b99fe92e31
commit ba245bf505
3 changed files with 30 additions and 0 deletions

View File

@ -89,6 +89,9 @@
// VC++5.0 has an internal compiler error (sometimes) without this
#undef HAVE_CPP_USING
#endif
#define NSCAP_FEATURE_INLINE_STARTASSIGNMENT
// under VC++, we win by inlining StartAssignment
#endif
@ -412,7 +415,14 @@ class nsCOMPtr : private nsCOMPtr_base
T**
StartAssignment()
{
#ifndef NSCAP_FEATURE_INLINE_STARTASSIGNMENT
return NSCAP_REINTERPRET_CAST(T**, begin_assignment());
#else
if ( mRawPtr )
NSCAP_RELEASE(mRawPtr);
mRawPtr = 0;
return NSCAP_REINTERPRET_CAST(T**, &mRawPtr);
#endif
}
};

View File

@ -89,6 +89,9 @@
// VC++5.0 has an internal compiler error (sometimes) without this
#undef HAVE_CPP_USING
#endif
#define NSCAP_FEATURE_INLINE_STARTASSIGNMENT
// under VC++, we win by inlining StartAssignment
#endif
@ -412,7 +415,14 @@ class nsCOMPtr : private nsCOMPtr_base
T**
StartAssignment()
{
#ifndef NSCAP_FEATURE_INLINE_STARTASSIGNMENT
return NSCAP_REINTERPRET_CAST(T**, begin_assignment());
#else
if ( mRawPtr )
NSCAP_RELEASE(mRawPtr);
mRawPtr = 0;
return NSCAP_REINTERPRET_CAST(T**, &mRawPtr);
#endif
}
};

View File

@ -89,6 +89,9 @@
// VC++5.0 has an internal compiler error (sometimes) without this
#undef HAVE_CPP_USING
#endif
#define NSCAP_FEATURE_INLINE_STARTASSIGNMENT
// under VC++, we win by inlining StartAssignment
#endif
@ -412,7 +415,14 @@ class nsCOMPtr : private nsCOMPtr_base
T**
StartAssignment()
{
#ifndef NSCAP_FEATURE_INLINE_STARTASSIGNMENT
return NSCAP_REINTERPRET_CAST(T**, begin_assignment());
#else
if ( mRawPtr )
NSCAP_RELEASE(mRawPtr);
mRawPtr = 0;
return NSCAP_REINTERPRET_CAST(T**, &mRawPtr);
#endif
}
};