mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Share zval_make_interned_string() helper
The same function was defined in zend_compile.c and zend_API.c.
This commit is contained in:
parent
36d2dd087a
commit
c4f4f1ece7
3 changed files with 2 additions and 11 deletions
|
@ -4024,16 +4024,6 @@ ZEND_API const char *zend_get_module_version(const char *module_name) /* {{{ */
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
static inline zend_string *zval_make_interned_string(zval *zv) /* {{{ */
|
|
||||||
{
|
|
||||||
ZEND_ASSERT(Z_TYPE_P(zv) == IS_STRING);
|
|
||||||
Z_STR_P(zv) = zend_new_interned_string(Z_STR_P(zv));
|
|
||||||
if (ZSTR_IS_INTERNED(Z_STR_P(zv))) {
|
|
||||||
Z_TYPE_FLAGS_P(zv) = 0;
|
|
||||||
}
|
|
||||||
return Z_STR_P(zv);
|
|
||||||
}
|
|
||||||
|
|
||||||
static zend_always_inline bool is_persistent_class(zend_class_entry *ce) {
|
static zend_always_inline bool is_persistent_class(zend_class_entry *ce) {
|
||||||
return (ce->type & ZEND_INTERNAL_CLASS)
|
return (ce->type & ZEND_INTERNAL_CLASS)
|
||||||
&& ce->info.internal.module->type == MODULE_PERSISTENT;
|
&& ce->info.internal.module->type == MODULE_PERSISTENT;
|
||||||
|
|
|
@ -501,7 +501,7 @@ static int lookup_cv(zend_string *name) /* {{{ */{
|
||||||
}
|
}
|
||||||
/* }}} */
|
/* }}} */
|
||||||
|
|
||||||
static inline zend_string *zval_make_interned_string(zval *zv) /* {{{ */
|
zend_string *zval_make_interned_string(zval *zv)
|
||||||
{
|
{
|
||||||
ZEND_ASSERT(Z_TYPE_P(zv) == IS_STRING);
|
ZEND_ASSERT(Z_TYPE_P(zv) == IS_STRING);
|
||||||
Z_STR_P(zv) = zend_new_interned_string(Z_STR_P(zv));
|
Z_STR_P(zv) = zend_new_interned_string(Z_STR_P(zv));
|
||||||
|
|
|
@ -815,6 +815,7 @@ void zend_resolve_goto_label(zend_op_array *op_array, zend_op *opline);
|
||||||
|
|
||||||
ZEND_API void function_add_ref(zend_function *function);
|
ZEND_API void function_add_ref(zend_function *function);
|
||||||
void zend_init_static_variables_map_ptr(zend_op_array *op_array);
|
void zend_init_static_variables_map_ptr(zend_op_array *op_array);
|
||||||
|
zend_string *zval_make_interned_string(zval *zv);
|
||||||
|
|
||||||
#define INITIAL_OP_ARRAY_SIZE 64
|
#define INITIAL_OP_ARRAY_SIZE 64
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue