Kill another TSRMLS_FETCH() in the zend extension loading code

This commit is contained in:
Kalle Sommer Nielsen 2013-12-18 07:59:47 +01:00
parent 2eb9bd316d
commit bd58146ad6
6 changed files with 13 additions and 15 deletions

View File

@ -24,7 +24,7 @@
ZEND_API zend_llist zend_extensions;
static int last_resource_number;
int zend_load_extension(const char *path)
int zend_load_extension(const char *path TSRMLS_DC)
{
#if ZEND_EXTENSIONS_SUPPORT
DL_HANDLE handle;
@ -107,7 +107,7 @@ int zend_load_extension(const char *path)
return FAILURE;
}
return zend_register_extension(new_extension, handle);
return zend_register_extension(new_extension, handle TSRMLS_CC);
#else
fprintf(stderr, "Extensions are not supported on this platform.\n");
/* See http://support.microsoft.com/kb/190351 */
@ -119,7 +119,7 @@ int zend_load_extension(const char *path)
}
int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle)
int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle TSRMLS_DC)
{
#if ZEND_EXTENSIONS_SUPPORT
zend_extension extension;
@ -127,7 +127,7 @@ int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle)
extension = *new_extension;
extension.handle = handle;
zend_extension_dispatch_message(ZEND_EXTMSG_NEW_EXTENSION, &extension);
zend_extension_dispatch_message(ZEND_EXTMSG_NEW_EXTENSION, &extension TSRMLS_CC);
zend_llist_add_element(&zend_extensions, &extension);
@ -208,10 +208,8 @@ static void zend_extension_message_dispatcher(const zend_extension *extension, i
}
ZEND_API void zend_extension_dispatch_message(int message, void *arg)
ZEND_API void zend_extension_dispatch_message(int message, void *arg TSRMLS_DC)
{
TSRMLS_FETCH();
zend_llist_apply_with_arguments(&zend_extensions, (llist_apply_with_args_func_t) zend_extension_message_dispatcher TSRMLS_CC, 2, message, arg);
}

View File

@ -94,7 +94,7 @@ struct _zend_extension {
BEGIN_EXTERN_C()
ZEND_API int zend_get_resource_handle(zend_extension *extension);
ZEND_API void zend_extension_dispatch_message(int message, void *arg);
ZEND_API void zend_extension_dispatch_message(int message, void *arg TSRMLS_DC);
END_EXTERN_C()
#define ZEND_EXTMSG_NEW_EXTENSION 1
@ -117,8 +117,8 @@ int zend_startup_extensions(void);
void zend_shutdown_extensions(TSRMLS_D);
BEGIN_EXTERN_C()
ZEND_API int zend_load_extension(const char *path);
ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle);
ZEND_API int zend_load_extension(const char *path TSRMLS_DC);
ZEND_API int zend_register_extension(zend_extension *new_extension, DL_HANDLE handle TSRMLS_DC);
ZEND_API zend_extension *zend_get_extension(const char *extension_name);
END_EXTERN_C()

View File

@ -361,7 +361,7 @@ static void php_load_zend_extension_cb(void *arg TSRMLS_DC)
int length = strlen(filename);
if (IS_ABSOLUTE_PATH(filename, length)) {
zend_load_extension(filename);
zend_load_extension(filename TSRMLS_CC);
} else {
char *libpath;
char *extension_dir = INI_STR("extension_dir");
@ -372,7 +372,7 @@ static void php_load_zend_extension_cb(void *arg TSRMLS_DC)
} else {
spprintf(&libpath, 0, "%s%c%s", extension_dir, DEFAULT_SLASH, filename);
}
zend_load_extension(libpath);
zend_load_extension(libpath TSRMLS_CC);
efree(libpath);
}
}

View File

@ -2240,7 +2240,7 @@ consult the installation file that came with this distribution, or visit \n\
break;
case 'z': /* load extension file */
zend_load_extension(php_optarg);
zend_load_extension(php_optarg TSRMLS_CC);
break;
default:

View File

@ -870,7 +870,7 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
break;
case 'z': /* load extension file */
zend_load_extension(php_optarg);
zend_load_extension(php_optarg TSRMLS_CC);
break;
case 'H':
hide_argv = 1;

View File

@ -1119,7 +1119,7 @@ int main(int argc, char *argv[])
break;
case 'z': /* load extension file */
zend_load_extension(ap_php_optarg);
zend_load_extension(ap_php_optarg TSRMLS_CC);
break;
default: