summaryrefslogtreecommitdiff
path: root/ext/com_dotnet
diff options
context:
space:
mode:
authorKalle Sommer Nielsen <kalle@php.net>2010-09-23 04:50:26 +0000
committerKalle Sommer Nielsen <kalle@php.net>2010-09-23 04:50:26 +0000
commit9c4a92cf51cee91416270ad6692b7fc5bdbca119 (patch)
tree8a10ba2ffd67927e855cc8cc88cf8276bf1fb766 /ext/com_dotnet
parenta89b97102e7c84987b26e0ba0c949d0f15ee130b (diff)
downloadphp-git-9c4a92cf51cee91416270ad6692b7fc5bdbca119.tar.gz
There are a few cases where we can save a TSRMLS_FETCH() call here
Diffstat (limited to 'ext/com_dotnet')
-rwxr-xr-xext/com_dotnet/com_persist.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c
index 3bbf2511d3..caf84f5194 100755
--- a/ext/com_dotnet/com_persist.c
+++ b/ext/com_dotnet/com_persist.c
@@ -58,13 +58,18 @@ static void istream_dtor(zend_rsrc_list_entry *rsrc TSRMLS_DC)
TSRMLS_FETCH(); \
if (GetCurrentThreadId() != stm->engine_thread) \
return RPC_E_WRONG_THREAD;
+
+#define FETCH_STM_EX() \
+ php_istream *stm = (php_istream*)This; \
+ if (GetCurrentThreadId() != stm->engine_thread) \
+ return RPC_E_WRONG_THREAD;
static HRESULT STDMETHODCALLTYPE stm_queryinterface(
IStream *This,
/* [in] */ REFIID riid,
/* [iid_is][out] */ void **ppvObject)
{
- FETCH_STM();
+ FETCH_STM_EX();
if (IsEqualGUID(&IID_IUnknown, riid) ||
IsEqualGUID(&IID_IStream, riid)) {
@@ -79,7 +84,7 @@ static HRESULT STDMETHODCALLTYPE stm_queryinterface(
static ULONG STDMETHODCALLTYPE stm_addref(IStream *This)
{
- FETCH_STM();
+ FETCH_STM_EX();
return InterlockedIncrement(&stm->refcount);
}
@@ -184,7 +189,7 @@ static HRESULT STDMETHODCALLTYPE stm_set_size(IStream *This, ULARGE_INTEGER libN
static HRESULT STDMETHODCALLTYPE stm_copy_to(IStream *This, IStream *pstm, ULARGE_INTEGER cb,
ULARGE_INTEGER *pcbRead, ULARGE_INTEGER *pcbWritten)
{
- FETCH_STM();
+ FETCH_STM_EX();
return E_NOTIMPL;
}