summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--UPGRADING.INTERNALS19
-rw-r--r--Zend/zend_list.c7
-rw-r--r--Zend/zend_list.h6
-rwxr-xr-xext/com_dotnet/com_persist.c2
-rw-r--r--ext/com_dotnet/com_wrapper.c2
-rw-r--r--ext/interbase/ibase_query.c2
-rw-r--r--ext/libxml/libxml.c2
-rw-r--r--ext/mssql/php_mssql.c2
-rw-r--r--ext/oci8/oci8.c10
-rw-r--r--ext/odbc/birdstep.c6
-rw-r--r--ext/openssl/openssl.c18
-rw-r--r--ext/openssl/xp_ssl.c4
-rw-r--r--ext/pgsql/pgsql.c2
-rw-r--r--ext/pspell/pspell.c2
-rw-r--r--ext/shmop/shmop.c2
-rw-r--r--ext/soap/php_http.c2
-rw-r--r--ext/soap/soap.c6
-rw-r--r--ext/standard/file.c2
-rw-r--r--ext/standard/file.h2
-rw-r--r--ext/standard/streamsfuncs.c2
-rw-r--r--ext/sysvmsg/sysvmsg.c2
-rw-r--r--main/streams/php_stream_context.h2
-rwxr-xr-xmain/streams/streams.c4
23 files changed, 63 insertions, 45 deletions
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS
index 4b5dac1b58..08e3085194 100644
--- a/UPGRADING.INTERNALS
+++ b/UPGRADING.INTERNALS
@@ -66,4 +66,23 @@ ZEND_FAST_FREE_REL(p, fc_type)
Use emalloc, emalloc_rel, efree or efree_rel instead.
+ f. zend_list_insert
+zend_list_insert uses now TSRMLS_DC:
+ZEND_API int zend_list_insert(void *ptr, int type TSRMLS_DC);
+
+it has to be called using:
+
+zend_list_insert(a, SOMETYPE TSRMLS_CC);
+
+If zend_list_insert is used to register a resource, ZEND_REGISTER_RESOURCE
+could be used instead.
+
+ g. php_le_stream_context(TSRMLS_C)
+php_le_stream_context uses now TSRMLS_D:
+
+PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D)
+
+it has to be called using:
+
+context = php_stream_context_alloc(TSRMLS_C);
diff --git a/Zend/zend_list.c b/Zend/zend_list.c
index 83377e401b..b9d20dcc8b 100644
--- a/Zend/zend_list.c
+++ b/Zend/zend_list.c
@@ -32,11 +32,10 @@ ZEND_API int le_index_ptr;
static HashTable list_destructors;
-ZEND_API int zend_list_insert(void *ptr, int type)
+ZEND_API int zend_list_insert(void *ptr, int type TSRMLS_DC)
{
int index;
zend_rsrc_list_entry le;
- TSRMLS_FETCH();
le.ptr=ptr;
le.type=type;
@@ -92,11 +91,11 @@ ZEND_API int _zend_list_addref(int id TSRMLS_DC)
}
-ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type)
+ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type TSRMLS_DC)
{
int rsrc_id;
- rsrc_id = zend_list_insert(rsrc_pointer, rsrc_type);
+ rsrc_id = zend_list_insert(rsrc_pointer, rsrc_type TSRMLS_CC);
if (rsrc_result) {
rsrc_result->value.lval = rsrc_id;
diff --git a/Zend/zend_list.h b/Zend/zend_list.h
index 67a63e35bb..35fcc38483 100644
--- a/Zend/zend_list.h
+++ b/Zend/zend_list.h
@@ -70,7 +70,7 @@ void zend_destroy_rsrc_list(HashTable *ht TSRMLS_DC);
int zend_init_rsrc_list_dtors(void);
void zend_destroy_rsrc_list_dtors(void);
-ZEND_API int zend_list_insert(void *ptr, int type);
+ZEND_API int zend_list_insert(void *ptr, int type TSRMLS_DC);
ZEND_API int _zend_list_addref(int id TSRMLS_DC);
ZEND_API int _zend_list_delete(int id TSRMLS_DC);
ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC);
@@ -79,7 +79,7 @@ ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC);
#define zend_list_delete(id) _zend_list_delete(id TSRMLS_CC)
#define zend_list_find(id, type) _zend_list_find(id, type TSRMLS_CC)
-ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type);
+ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int rsrc_type TSRMLS_DC);
ZEND_API void *zend_fetch_resource(zval **passed_id TSRMLS_DC, int default_id, char *resource_type_name, int *found_resource_type, int num_resource_types, ...);
ZEND_API char *zend_rsrc_list_get_rsrc_type(int resource TSRMLS_DC);
@@ -107,7 +107,7 @@ extern ZEND_API int le_index_ptr; /* list entry type for index pointers */
(rsrc = (rsrc_type) zend_fetch_resource(passed_id TSRMLS_CC, default_id, resource_type_name, NULL, 2, resource_type1, resource_type2))
#define ZEND_REGISTER_RESOURCE(rsrc_result, rsrc_pointer, rsrc_type) \
- zend_register_resource(rsrc_result, rsrc_pointer, rsrc_type);
+ zend_register_resource(rsrc_result, rsrc_pointer, rsrc_type TSRMLS_CC);
#define ZEND_GET_RESOURCE_TYPE_ID(le_id, le_type_name) \
if (le_id == 0) { \
diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c
index cca51ec6a3..3bbf2511d3 100755
--- a/ext/com_dotnet/com_persist.c
+++ b/ext/com_dotnet/com_persist.c
@@ -277,7 +277,7 @@ PHPAPI IStream *php_com_wrapper_export_stream(php_stream *stream TSRMLS_DC)
stm->stream = stream;
zend_list_addref(stream->rsrc_id);
- stm->id = zend_list_insert(stm, le_istream);
+ stm->id = zend_list_insert(stm, le_istream TSRMLS_CC);
return (IStream*)stm;
}
diff --git a/ext/com_dotnet/com_wrapper.c b/ext/com_dotnet/com_wrapper.c
index 6f0a2d35f5..598843c84e 100644
--- a/ext/com_dotnet/com_wrapper.c
+++ b/ext/com_dotnet/com_wrapper.c
@@ -548,7 +548,7 @@ static php_dispatchex *disp_constructor(zval *object TSRMLS_DC)
Z_ADDREF_P(object);
disp->object = object;
- disp->id = zend_list_insert(disp, le_dispatch);
+ disp->id = zend_list_insert(disp, le_dispatch TSRMLS_CC);
return disp;
}
diff --git a/ext/interbase/ibase_query.c b/ext/interbase/ibase_query.c
index 82bb0bbd8d..f5fd93a813 100644
--- a/ext/interbase/ibase_query.c
+++ b/ext/interbase/ibase_query.c
@@ -1857,7 +1857,7 @@ PHP_FUNCTION(ibase_execute)
if (ib_query->statement_type == isc_info_sql_stmt_exec_procedure) {
result->stmt = NULL;
}
- ib_query->result_res_id = zend_list_insert(result, le_result);
+ ib_query->result_res_id = zend_list_insert(result, le_result TSRMLS_CC);
RETVAL_RESOURCE(ib_query->result_res_id);
}
} while (0);
diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c
index 8d07a18055..f3e6745a9e 100644
--- a/ext/libxml/libxml.c
+++ b/ext/libxml/libxml.c
@@ -313,7 +313,7 @@ static void *php_libxml_streams_IO_open_wrapper(const char *filename, const char
}
if (LIBXML(stream_context)) {
- context = zend_fetch_resource(&LIBXML(stream_context) TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context());
+ context = zend_fetch_resource(&LIBXML(stream_context) TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context(TSRMLS_C));
}
ret_val = php_stream_open_wrapper_ex(path_to_open, (char *)mode, REPORT_ERRORS, NULL, context);
diff --git a/ext/mssql/php_mssql.c b/ext/mssql/php_mssql.c
index 84f6138bc5..70bc6b6a86 100644
--- a/ext/mssql/php_mssql.c
+++ b/ext/mssql/php_mssql.c
@@ -1998,7 +1998,7 @@ PHP_FUNCTION(mssql_init)
statement->link = mssql_ptr;
statement->executed=FALSE;
- statement->id = zend_list_insert(statement,le_statement);
+ statement->id = zend_list_insert(statement,le_statement TSRMLS_CC);
RETURN_RESOURCE(statement->id);
}
diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c
index 6fd1389117..f952115bbb 100644
--- a/ext/oci8/oci8.c
+++ b/ext/oci8/oci8.c
@@ -1909,7 +1909,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
memcmp(tmp->hash_key, hashed_details.c, hashed_details.len) == 0 && zend_list_addref(connection->rsrc_id) == SUCCESS) {
/* do nothing */
} else {
- connection->rsrc_id = zend_list_insert(connection, le_pconnection);
+ connection->rsrc_id = zend_list_insert(connection, le_pconnection TSRMLS_CC);
/* Persistent connections: For old close semantics we artificially
* bump up the refcount to prevent the non-persistent destructor
* from getting called until request shutdown. The refcount is
@@ -2053,7 +2053,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
new_le.ptr = connection;
new_le.type = le_pconnection;
connection->used_this_request = 1;
- connection->rsrc_id = zend_list_insert(connection, le_pconnection);
+ connection->rsrc_id = zend_list_insert(connection, le_pconnection TSRMLS_CC);
/* Persistent connections: For old close semantics we artificially bump up the refcount to
* prevent the non-persistent destructor from getting called until request shutdown. The
@@ -2066,13 +2066,13 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char
OCI_G(num_persistent)++;
OCI_G(num_links)++;
} else if (!exclusive) {
- connection->rsrc_id = zend_list_insert(connection, le_connection);
+ connection->rsrc_id = zend_list_insert(connection, le_connection TSRMLS_CC);
new_le.ptr = (void *)connection->rsrc_id;
new_le.type = le_index_ptr;
zend_hash_update(&EG(regular_list), connection->hash_key, strlen(connection->hash_key)+1, (void *)&new_le, sizeof(zend_rsrc_list_entry), NULL);
OCI_G(num_links)++;
} else {
- connection->rsrc_id = zend_list_insert(connection, le_connection);
+ connection->rsrc_id = zend_list_insert(connection, le_connection TSRMLS_CC);
OCI_G(num_links)++;
}
@@ -2765,7 +2765,7 @@ static php_oci_spool *php_oci_get_spool(char *username, int username_len, char *
}
spool_le.ptr = session_pool;
spool_le.type = le_psessionpool;
- zend_list_insert(session_pool, le_psessionpool);
+ zend_list_insert(session_pool, le_psessionpool TSRMLS_CC);
zend_hash_update(&EG(persistent_list), session_pool->spool_hash_key, strlen(session_pool->spool_hash_key)+1,(void *)&spool_le, sizeof(zend_rsrc_list_entry),NULL);
} else if (spool_out_le->type == le_psessionpool &&
strlen(((php_oci_spool *)(spool_out_le->ptr))->spool_hash_key) == spool_hashed_details.len &&
diff --git a/ext/odbc/birdstep.c b/ext/odbc/birdstep.c
index 1fe2a883b9..bc6779b4ca 100644
--- a/ext/odbc/birdstep.c
+++ b/ext/odbc/birdstep.c
@@ -224,11 +224,11 @@ PHP_MSHUTDOWN_FUNCTION(birdstep)
/* Some internal functions. Connections and result manupulate */
-static int birdstep_add_conn(HashTable *list,VConn *conn,HDBC hdbc)
+static int birdstep_add_conn(HashTable *list,VConn *conn,HDBC hdbc TSRMLS_DC)
{
int ind;
- ind = zend_list_insert(conn,php_birdstep_module.le_link);
+ ind = zend_list_insert(conn,php_birdstep_module.le_link TSRMLS_CC);
conn->hdbc = hdbc;
conn->index = ind;
@@ -314,7 +314,7 @@ PHP_FUNCTION(birdstep_connect)
RETURN_FALSE;
}
new = (VConn *)emalloc(sizeof(VConn));
- ind = birdstep_add_conn(list,new,hdbc);
+ ind = birdstep_add_conn(list,new,hdbc TSRMLS_CC);
php_birdstep_module.num_links++;
RETURN_LONG(ind);
}
diff --git a/ext/openssl/openssl.c b/ext/openssl/openssl.c
index 044bd5eb1e..ac2fcd4bfc 100644
--- a/ext/openssl/openssl.c
+++ b/ext/openssl/openssl.c
@@ -1236,7 +1236,7 @@ static X509 * php_openssl_x509_from_zval(zval ** val, int makeresource, long * r
}
if (cert && makeresource && resourceval) {
- *resourceval = zend_list_insert(cert, le_x509);
+ *resourceval = zend_list_insert(cert, le_x509 TSRMLS_CC);
}
return cert;
}
@@ -2435,7 +2435,7 @@ PHP_FUNCTION(openssl_csr_sign)
}
/* Succeeded; lets return the cert */
- RETVAL_RESOURCE(zend_list_insert(new_cert, le_x509));
+ RETVAL_RESOURCE(zend_list_insert(new_cert, le_x509 TSRMLS_CC));
new_cert = NULL;
cleanup:
@@ -2512,7 +2512,7 @@ PHP_FUNCTION(openssl_csr_new)
RETVAL_TRUE;
if (X509_REQ_sign(csr, req.priv_key, req.digest)) {
- RETVAL_RESOURCE(zend_list_insert(csr, le_csr));
+ RETVAL_RESOURCE(zend_list_insert(csr, le_csr TSRMLS_CC));
csr = NULL;
} else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error signing request");
@@ -2521,7 +2521,7 @@ PHP_FUNCTION(openssl_csr_new)
if (we_made_the_key) {
/* and a resource for the private key */
zval_dtor(out_pkey);
- ZVAL_RESOURCE(out_pkey, zend_list_insert(req.priv_key, le_key));
+ ZVAL_RESOURCE(out_pkey, zend_list_insert(req.priv_key, le_key TSRMLS_CC));
req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */
} else if (key_resource != -1) {
req.priv_key = NULL; /* make sure the cleanup code doesn't zap it! */
@@ -2594,7 +2594,7 @@ PHP_FUNCTION(openssl_csr_get_public_key)
}
tpubkey=X509_REQ_get_pubkey(csr);
- RETVAL_RESOURCE(zend_list_insert(tpubkey, le_key));
+ RETVAL_RESOURCE(zend_list_insert(tpubkey, le_key TSRMLS_CC));
return;
}
/* }}} */
@@ -2948,7 +2948,7 @@ PHP_FUNCTION(openssl_pkey_new)
OPENSSL_PKEY_SET_BN(Z_ARRVAL_PP(data), rsa, iqmp);
if (rsa->n && rsa->d) {
if (EVP_PKEY_assign_RSA(pkey, rsa)) {
- RETURN_RESOURCE(zend_list_insert(pkey, le_key));
+ RETURN_RESOURCE(zend_list_insert(pkey, le_key TSRMLS_CC));
}
}
RSA_free(rsa);
@@ -2972,7 +2972,7 @@ PHP_FUNCTION(openssl_pkey_new)
DSA_generate_key(dsa);
}
if (EVP_PKEY_assign_DSA(pkey, dsa)) {
- RETURN_RESOURCE(zend_list_insert(pkey, le_key));
+ RETURN_RESOURCE(zend_list_insert(pkey, le_key TSRMLS_CC));
}
}
DSA_free(dsa);
@@ -2995,7 +2995,7 @@ PHP_FUNCTION(openssl_pkey_new)
DH_generate_key(dh);
}
if (EVP_PKEY_assign_DH(pkey, dh)) {
- RETURN_RESOURCE(zend_list_insert(pkey, le_key));
+ RETURN_RESOURCE(zend_list_insert(pkey, le_key TSRMLS_CC));
}
}
DH_free(dh);
@@ -3012,7 +3012,7 @@ PHP_FUNCTION(openssl_pkey_new)
{
if (php_openssl_generate_private_key(&req TSRMLS_CC)) {
/* pass back a key resource */
- RETVAL_RESOURCE(zend_list_insert(req.priv_key, le_key));
+ RETVAL_RESOURCE(zend_list_insert(req.priv_key, le_key TSRMLS_CC));
/* make sure the cleanup code doesn't zap it! */
req.priv_key = NULL;
}
diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c
index 412a445d11..c265869966 100644
--- a/ext/openssl/xp_ssl.c
+++ b/ext/openssl/xp_ssl.c
@@ -471,7 +471,7 @@ static inline int php_openssl_enable_crypto(php_stream *stream,
zval_is_true(*val)) {
MAKE_STD_ZVAL(zcert);
ZVAL_RESOURCE(zcert, zend_list_insert(peer_cert,
- php_openssl_get_x509_list_id()));
+ php_openssl_get_x509_list_id() TSRMLS_CC));
php_stream_context_set_option(stream->context,
"ssl", "peer_certificate",
zcert);
@@ -500,7 +500,7 @@ static inline int php_openssl_enable_crypto(php_stream *stream,
MAKE_STD_ZVAL(zcert);
ZVAL_RESOURCE(zcert,
zend_list_insert(mycert,
- php_openssl_get_x509_list_id()));
+ php_openssl_get_x509_list_id() TSRMLS_CC));
add_next_index_zval(arr, zcert);
FREE_ZVAL(zcert);
}
diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c
index afb22f615e..e10d8ce514 100644
--- a/ext/pgsql/pgsql.c
+++ b/ext/pgsql/pgsql.c
@@ -3169,7 +3169,7 @@ PHP_FUNCTION(pg_lo_open)
} else {
pgsql_lofp->conn = pgsql;
pgsql_lofp->lofd = pgsql_lofd;
- Z_LVAL_P(return_value) = zend_list_insert(pgsql_lofp, le_lofp);
+ Z_LVAL_P(return_value) = zend_list_insert(pgsql_lofp, le_lofp TSRMLS_CC);
Z_TYPE_P(return_value) = IS_LONG;
}
}
diff --git a/ext/pspell/pspell.c b/ext/pspell/pspell.c
index bc4af64094..ae7c173699 100644
--- a/ext/pspell/pspell.c
+++ b/ext/pspell/pspell.c
@@ -347,7 +347,7 @@ static PHP_FUNCTION(pspell_new)
}
manager = to_pspell_manager(ret);
- ind = zend_list_insert(manager, le_pspell);
+ ind = zend_list_insert(manager, le_pspell TSRMLS_CC);
RETURN_LONG(ind);
}
/* }}} */
diff --git a/ext/shmop/shmop.c b/ext/shmop/shmop.c
index c6e930c01e..7e057afae7 100644
--- a/ext/shmop/shmop.c
+++ b/ext/shmop/shmop.c
@@ -226,7 +226,7 @@ PHP_FUNCTION(shmop_open)
shmop->size = shm.shm_segsz;
- rsid = zend_list_insert(shmop, shm_type);
+ rsid = zend_list_insert(shmop, shm_type TSRMLS_CC);
RETURN_LONG(rsid);
err:
efree(shmop);
diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c
index c1bcf926a2..f01a4541d0 100644
--- a/ext/soap/php_http.c
+++ b/ext/soap/php_http.c
@@ -380,7 +380,7 @@ try_again:
if (stream) {
zval **cookies, **login, **password;
- int ret = zend_list_insert(phpurl, le_url);
+ int ret = zend_list_insert(phpurl, le_url TSRMLS_CC);
add_property_resource(this_ptr, "httpurl", ret);
/*zend_list_addref(ret);*/
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 2265575b58..f447896d96 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -1298,7 +1298,7 @@ PHP_METHOD(SoapServer, SoapServer)
service->typemap = soap_create_typemap(service->sdl, typemap_ht TSRMLS_CC);
}
- ret = zend_list_insert(service, le_service);
+ ret = zend_list_insert(service, le_service TSRMLS_CC);
add_property_resource(this_ptr, "service", ret);
SOAP_SERVER_END_CODE();
@@ -2621,7 +2621,7 @@ PHP_METHOD(SoapClient, SoapClient)
SOAP_GLOBAL(soap_version) = soap_version;
sdl = get_sdl(this_ptr, Z_STRVAL_P(wsdl), cache_wsdl TSRMLS_CC);
- ret = zend_list_insert(sdl, le_sdl);
+ ret = zend_list_insert(sdl, le_sdl TSRMLS_CC);
add_property_resource(this_ptr, "sdl", ret);
@@ -2633,7 +2633,7 @@ PHP_METHOD(SoapClient, SoapClient)
if (typemap) {
int ret;
- ret = zend_list_insert(typemap, le_typemap);
+ ret = zend_list_insert(typemap, le_typemap TSRMLS_CC);
add_property_resource(this_ptr, "typemap", ret);
}
}
diff --git a/ext/standard/file.c b/ext/standard/file.c
index ddbeb02642..2d7e581bbc 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -138,7 +138,7 @@ php_file_globals file_globals;
/* sharing globals is *evil* */
static int le_stream_context = FAILURE;
-PHPAPI int php_le_stream_context(void)
+PHPAPI int php_le_stream_context(TSRMLS_D)
{
return le_stream_context;
}
diff --git a/ext/standard/file.h b/ext/standard/file.h
index eef483af96..cdf356f352 100644
--- a/ext/standard/file.h
+++ b/ext/standard/file.h
@@ -72,7 +72,7 @@ PHP_FUNCTION(sys_get_temp_dir);
PHP_MINIT_FUNCTION(user_streams);
-PHPAPI int php_le_stream_context(void);
+PHPAPI int php_le_stream_context(TSRMLS_D);
PHPAPI int php_set_sock_blocking(int socketd, int block TSRMLS_DC);
PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC);
PHPAPI int php_copy_file_ex(char *src, char *dest, int src_chk TSRMLS_DC);
diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c
index d1a07ac5b0..e88bdf751a 100644
--- a/ext/standard/streamsfuncs.c
+++ b/ext/standard/streamsfuncs.c
@@ -953,7 +953,7 @@ static php_stream_context *decode_context_param(zval *contextresource TSRMLS_DC)
{
php_stream_context *context = NULL;
- context = zend_fetch_resource(&contextresource TSRMLS_CC, -1, NULL, NULL, 1, php_le_stream_context());
+ context = zend_fetch_resource(&contextresource TSRMLS_CC, -1, NULL, NULL, 1, php_le_stream_context(TSRMLS_C));
if (context == NULL) {
php_stream *stream;
diff --git a/ext/sysvmsg/sysvmsg.c b/ext/sysvmsg/sysvmsg.c
index 9a044580b1..4ed09f4a2f 100644
--- a/ext/sysvmsg/sysvmsg.c
+++ b/ext/sysvmsg/sysvmsg.c
@@ -271,7 +271,7 @@ PHP_FUNCTION(msg_get_queue)
RETURN_FALSE;
}
}
- RETVAL_RESOURCE(zend_list_insert(mq, le_sysvmsg));
+ RETVAL_RESOURCE(zend_list_insert(mq, le_sysvmsg TSRMLS_CC));
}
/* }}} */
diff --git a/main/streams/php_stream_context.h b/main/streams/php_stream_context.h
index c14b37ef58..52c3875ec7 100644
--- a/main/streams/php_stream_context.h
+++ b/main/streams/php_stream_context.h
@@ -33,7 +33,7 @@ typedef void (*php_stream_notification_func)(php_stream_context *context,
If no context was passed, use the default context
The the default context has not yet been created, do it now. */
#define php_stream_context_from_zval(zcontext, nocontext) ( \
- (zcontext) ? zend_fetch_resource(&(zcontext) TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context()) : \
+ (zcontext) ? zend_fetch_resource(&(zcontext) TSRMLS_CC, -1, "Stream-Context", NULL, 1, php_le_stream_context(TSRMLS_C)) : \
(nocontext) ? NULL : \
FG(default_context) ? FG(default_context) : \
(FG(default_context) = php_stream_context_alloc()) )
diff --git a/main/streams/streams.c b/main/streams/streams.c
index 6aa52b3cb4..5610d0cba0 100755
--- a/main/streams/streams.c
+++ b/main/streams/streams.c
@@ -1998,7 +1998,7 @@ PHPAPI void php_stream_context_free(php_stream_context *context)
efree(context);
}
-PHPAPI php_stream_context *php_stream_context_alloc(void)
+PHPAPI php_stream_context *php_stream_context_alloc(TSRMLS_D)
{
php_stream_context *context;
@@ -2007,7 +2007,7 @@ PHPAPI php_stream_context *php_stream_context_alloc(void)
MAKE_STD_ZVAL(context->options);
array_init(context->options);
- context->rsrc_id = ZEND_REGISTER_RESOURCE(NULL, context, php_le_stream_context());
+ context->rsrc_id = ZEND_REGISTER_RESOURCE(NULL, context, php_le_stream_context(TSRMLS_C));
return context;
}