Fixed ZTS build

This commit is contained in:
Dmitry Stogov 2010-05-24 17:07:52 +00:00
parent 04dd48ceca
commit f23e857676
7 changed files with 13 additions and 13 deletions

View File

@ -505,9 +505,9 @@ static void compiler_globals_ctor(zend_compiler_globals *compiler_globals TSRMLS
compiler_globals->last_static_member = zend_hash_num_elements(compiler_globals->class_table);
if (compiler_globals->last_static_member) {
compiler_globals->static_members = (HashTable**)calloc(compiler_globals->last_static_member, sizeof(HashTable*));
compiler_globals->static_members_table = calloc(compiler_globals->last_static_member, sizeof(zval**));
} else {
compiler_globals->static_members = NULL;
compiler_globals->static_members_table = NULL;
}
}
/* }}} */
@ -526,8 +526,8 @@ static void compiler_globals_dtor(zend_compiler_globals *compiler_globals TSRMLS
zend_hash_destroy(compiler_globals->auto_globals);
free(compiler_globals->auto_globals);
}
if (compiler_globals->static_members) {
free(compiler_globals->static_members);
if (compiler_globals->static_members_table) {
free(compiler_globals->static_members_table);
}
compiler_globals->last_static_member = 0;
}

View File

@ -1026,7 +1026,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
zend_update_class_constants(class_type->parent TSRMLS_CC);
}
#if ZTS
CG(static_members)[(zend_intptr_t)(class_type->static_members)] = emalloc(sizeof(zval*) * class_type->default_static_members_count);
CG(static_members_table)[(zend_intptr_t)(class_type->static_members_table)] = emalloc(sizeof(zval*) * class_type->default_static_members_count);
#else
class_type->static_members_table = emalloc(sizeof(zval*) * class_type->default_static_members_count);
#endif

View File

@ -208,7 +208,7 @@ typedef struct _zend_fcall_info_cache {
INIT_OVERLOADED_CLASS_ENTRY(class_container, ZEND_NS_NAME(ns, class_name), functions, handle_fcall, handle_propget, handle_propset)
#ifdef ZTS
# define CE_STATIC_MEMBERS(ce) (((ce)->type==ZEND_USER_CLASS)?(ce)->static_members:CG(static_members_table)[(zend_intptr_t)(ce)->static_members_table])
# define CE_STATIC_MEMBERS(ce) (((ce)->type==ZEND_USER_CLASS)?(ce)->static_members_table:CG(static_members_table)[(zend_intptr_t)(ce)->static_members_table])
#else
# define CE_STATIC_MEMBERS(ce) ((ce)->static_members_table)
#endif

View File

@ -6140,18 +6140,18 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify
#ifdef ZTS
int n = zend_hash_num_elements(CG(class_table));
if (CG(static_members) && n >= CG(last_static_member)) {
if (CG(static_members_table) && n >= CG(last_static_member)) {
/* Support for run-time declaration: dl() */
CG(last_static_member) = n+1;
CG(static_members) = realloc(CG(static_members), (n+1)*sizeof(HashTable*));
CG(static_members)[n] = NULL;
CG(static_members_table) = realloc(CG(static_members_table), (n+1)*sizeof(zval**));
CG(static_members_table)[n] = NULL;
}
ce->static_members_table = (zval**)(zend_intptr_t)n;
#else
ce->static_members_table = NULL;
#endif
} else {
ce->static_members_table = &ce->default_static_members_table;
ce->static_members_table = ce->default_static_members_table;
}
ce->default_properties_count = 0;

View File

@ -166,7 +166,7 @@ struct _zend_compiler_globals {
#endif /* ZEND_MULTIBYTE */
#ifdef ZTS
HashTable **static_members;
zval ***static_members_table;
int last_static_member;
#endif
};

View File

@ -175,7 +175,7 @@ ZEND_API int zend_cleanup_class_data(zend_class_entry **pce TSRMLS_DC)
}
efree(CE_STATIC_MEMBERS(*pce));
#ifdef ZTS
CG(static_members)[(zend_intptr_t)((*pce)->static_members)] = NULL;
CG(static_members_table)[(zend_intptr_t)((*pce)->static_members_table)] = NULL;
#else
(*pce)->static_members_table = NULL;
#endif

View File

@ -1564,7 +1564,7 @@ ZEND_METHOD(reflection_function, __construct)
MAKE_STD_ZVAL(name);
ZVAL_STRING(name, fptr->common.function_name, 1);
reflection_update_property(object, "name", name TSRMLS_CC);
reflection_update_property(object, "name", name);
intern->ptr = fptr;
intern->ref_type = REF_TYPE_FUNCTION;
intern->obj = closure;