1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

move SG to use global tsrmls pointer

This commit is contained in:
Anatol Belski
2014-10-15 18:23:41 +02:00
parent aff66a94a6
commit 2bddd58d32
2 changed files with 4 additions and 1 deletions

View File

@@ -64,6 +64,9 @@ static void _type_dtor(zval *zv)
static void sapi_globals_ctor(sapi_globals_struct *sapi_globals TSRMLS_DC)
{
#ifdef ZTS
ZEND_TSRMLS_CACHE_UPDATE;
#endif
memset(sapi_globals, 0, sizeof(*sapi_globals));
zend_hash_init_ex(&sapi_globals->known_post_content_types, 8, NULL, _type_dtor, 1, 0);
php_setup_sapi_content_types(TSRMLS_C);

View File

@@ -142,7 +142,7 @@ typedef struct _sapi_globals_struct {
BEGIN_EXTERN_C()
#ifdef ZTS
# define SG(v) TSRMG(sapi_globals_id, sapi_globals_struct *, v)
# define SG(v) ZEND_TSRMG(sapi_globals_id, sapi_globals_struct *, v)
SAPI_API extern int sapi_globals_id;
#else
# define SG(v) (sapi_globals.v)