diff options
Diffstat (limited to 'ext')
33 files changed, 58 insertions, 58 deletions
diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index ff7e28a525..d8445d295f 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -231,7 +231,7 @@ PHP_BZ2_API php_stream *_php_stream_bz2open_from_BZFILE(BZFILE *bz, self->stream = innerstream; if (innerstream) { - GC_REFCOUNT(innerstream->res)++; + GC_ADDREF(innerstream->res); } self->bz_file = bz; diff --git a/ext/com_dotnet/com_persist.c b/ext/com_dotnet/com_persist.c index 6ddbe63594..3938decb75 100644 --- a/ext/com_dotnet/com_persist.c +++ b/ext/com_dotnet/com_persist.c @@ -281,7 +281,7 @@ PHP_COM_DOTNET_API IStream *php_com_wrapper_export_stream(php_stream *stream) stm->refcount = 1; stm->stream = stream; - GC_REFCOUNT(stream->res)++; + GC_ADDREF(stream->res); tmp = zend_list_insert(stm, le_istream); stm->res = Z_RES_P(tmp); diff --git a/ext/dba/dba.c b/ext/dba/dba.c index 5dd03e86d7..671cb293e3 100644 --- a/ext/dba/dba.c +++ b/ext/dba/dba.c @@ -695,7 +695,7 @@ static void php_dba_open(INTERNAL_FUNCTION_PARAMETERS, int persistent) info = (dba_info *)le->ptr; - GC_REFCOUNT(le)++; + GC_ADDREF(le); RETURN_RES(zend_register_resource(info, le_pdb)); return; } diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c index 9892285cbb..00c8b40cb3 100644 --- a/ext/dom/php_dom.c +++ b/ext/dom/php_dom.c @@ -1199,7 +1199,7 @@ PHP_DOM_EXPORT zend_bool php_dom_create_object(xmlNodePtr obj, zval *return_valu } if ((intern = (dom_object *) php_dom_object_get_data((void *) obj))) { - GC_REFCOUNT(&intern->std)++; + GC_ADDREF(&intern->std); ZVAL_OBJ(return_value, &intern->std); return 1; } diff --git a/ext/enchant/enchant.c b/ext/enchant/enchant.c index 25edf66a74..be79035bba 100644 --- a/ext/enchant/enchant.c +++ b/ext/enchant/enchant.c @@ -567,7 +567,7 @@ PHP_FUNCTION(enchant_broker_request_dict) pbroker->dict[pos] = dict; dict->rsrc = zend_register_resource(dict, le_enchant_dict); - pbroker->rsrc->gc.refcount++; + GC_ADDREF(pbroker->rsrc); RETURN_RES(dict->rsrc); } else { RETURN_FALSE; @@ -614,7 +614,7 @@ PHP_FUNCTION(enchant_broker_request_pwl_dict) pbroker->dict[pos] = dict; dict->rsrc = zend_register_resource(dict, le_enchant_dict); - pbroker->rsrc->gc.refcount++; + GC_ADDREF(pbroker->rsrc); RETURN_RES(dict->rsrc); } else { RETURN_FALSE; diff --git a/ext/interbase/ibase_events.c b/ext/interbase/ibase_events.c index 001c43dded..919d912d5b 100644 --- a/ext/interbase/ibase_events.c +++ b/ext/interbase/ibase_events.c @@ -328,7 +328,7 @@ PHP_FUNCTION(ibase_set_event_handler) event = (ibase_event *) safe_emalloc(sizeof(ibase_event), 1, 0); TSRMLS_SET_CTX(event->thread_ctx); event->link_res = link_res; - GC_REFCOUNT(link_res)++; + GC_ADDREF(link_res); event->link = ib_link; event->event_count = 0; event->state = NEW; diff --git a/ext/intl/common/common_enum.cpp b/ext/intl/common/common_enum.cpp index 0531a6b933..b38ae9aa60 100644 --- a/ext/intl/common/common_enum.cpp +++ b/ext/intl/common/common_enum.cpp @@ -183,7 +183,7 @@ static zend_object_iterator *IntlIterator_get_iterator( return NULL; } - ++GC_REFCOUNT(&ii->iterator->std); + GC_ADDREF(&ii->iterator->std); return ii->iterator; } diff --git a/ext/intl/transliterator/transliterator_class.c b/ext/intl/transliterator/transliterator_class.c index 4325a45d06..9eb2304c5e 100644 --- a/ext/intl/transliterator/transliterator_class.c +++ b/ext/intl/transliterator/transliterator_class.c @@ -58,7 +58,7 @@ int transliterator_object_construct( zval *object, ZVAL_NEW_STR(&tmp, u8str); zend_update_property(Transliterator_ce_ptr, object, "id", sizeof( "id" ) - 1, &tmp ); - GC_REFCOUNT(u8str)--; + GC_DELREF(u8str); return SUCCESS; } /* }}} */ diff --git a/ext/libxml/libxml.c b/ext/libxml/libxml.c index 74a1736894..86a0e7eb27 100644 --- a/ext/libxml/libxml.c +++ b/ext/libxml/libxml.c @@ -654,7 +654,7 @@ is_string: "input buffer"); } else { /* make stream not being closed when the zval is freed */ - ++GC_REFCOUNT(stream->res); + GC_ADDREF(stream->res); pib->context = stream; pib->readcallback = php_libxml_streams_IO_read; pib->closecallback = php_libxml_streams_IO_close; diff --git a/ext/oci8/oci8.c b/ext/oci8/oci8.c index 8a26cf66ca..9d65685170 100644 --- a/ext/oci8/oci8.c +++ b/ext/oci8/oci8.c @@ -1456,7 +1456,7 @@ void php_oci_column_hash_dtor(zval *data) if (GC_REFCOUNT(column->descid) == 1) zend_list_close(column->descid); else - GC_REFCOUNT(column->descid)--; + GC_DELREF(column->descid); } if (column->data) { @@ -1878,7 +1878,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char (memcmp(ZSTR_VAL(tmp->hash_key), ZSTR_VAL(hashed_details.s), ZSTR_LEN(tmp->hash_key)) == 0)) { connection = tmp; - ++GC_REFCOUNT(connection->id); + GC_ADDREF(connection->id); } } else { PHP_OCI_REGISTER_RESOURCE(connection, le_pconnection); @@ -1888,7 +1888,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char * decremented in the persistent helper */ if (OCI_G(old_oci_close_semantics)) { - ++GC_REFCOUNT(connection->id); + GC_ADDREF(connection->id); } } smart_str_free(&hashed_details); @@ -1899,7 +1899,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char } else { /* we do not ping non-persistent connections */ smart_str_free(&hashed_details); - ++GC_REFCOUNT(connection->id); + GC_ADDREF(connection->id); return connection; } } /* is_open is true? */ @@ -2051,7 +2051,7 @@ php_oci_connection *php_oci_do_connect_ex(char *username, int username_len, char * refcount is decremented in the persistent helper */ if (OCI_G(old_oci_close_semantics)) { - ++GC_REFCOUNT(connection->id); + GC_ADDREF(connection->id); } zend_hash_update_mem(&EG(persistent_list), connection->hash_key, (void *)&new_le, sizeof(zend_resource)); OCI_G(num_persistent)++; @@ -2448,7 +2448,7 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode) if (column->is_cursor) { /* REFCURSOR -> simply return the statement id */ ZVAL_RES(value, column->stmtid); - ++GC_REFCOUNT(column->stmtid); + GC_ADDREF(column->stmtid); } else if (column->is_descr) { if (column->data_type != SQLT_RDD) { @@ -2492,7 +2492,7 @@ int php_oci_column_to_zval(php_oci_out_column *column, zval *value, int mode) /* return the locator */ object_init_ex(value, oci_lob_class_entry_ptr); add_property_resource(value, "descriptor", column->descid); - ++GC_REFCOUNT(column->descid); + GC_ADDREF(column->descid); } } else { switch (column->retcode) { diff --git a/ext/oci8/oci8_collection.c b/ext/oci8/oci8_collection.c index 9e0ea69120..83426e5975 100644 --- a/ext/oci8/oci8_collection.c +++ b/ext/oci8/oci8_collection.c @@ -52,7 +52,7 @@ php_oci_collection *php_oci_collection_create(php_oci_connection *connection, ch collection->connection = connection; collection->collection = NULL; - ++GC_REFCOUNT(collection->connection->id); + GC_ADDREF(collection->connection->id); /* get type handle by name */ PHP_OCI_CALL_RETURN(errstatus, OCITypeByName, diff --git a/ext/oci8/oci8_lob.c b/ext/oci8/oci8_lob.c index 5e3107edfc..349338cf0f 100644 --- a/ext/oci8/oci8_lob.c +++ b/ext/oci8/oci8_lob.c @@ -67,7 +67,7 @@ php_oci_descriptor *php_oci_lob_create (php_oci_connection *connection, zend_lon descriptor = ecalloc(1, sizeof(php_oci_descriptor)); descriptor->type = (ub4) type; descriptor->connection = connection; - ++GC_REFCOUNT(descriptor->connection->id); + GC_ADDREF(descriptor->connection->id); PHP_OCI_CALL_RETURN(errstatus, OCIDescriptorAlloc, (connection->env, (dvoid*)&(descriptor->descriptor), descriptor->type, (size_t) 0, (dvoid **) 0)); diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index f0cb16425a..1564e303e0 100644 --- a/ext/oci8/oci8_statement.c +++ b/ext/oci8/oci8_statement.c @@ -111,7 +111,7 @@ php_oci_statement *php_oci_statement_create(php_oci_connection *connection, char statement->impres_child_stmt = NULL; statement->impres_count = 0; statement->impres_flag = PHP_OCI_IMPRES_UNKNOWN; /* may or may not have Implicit Result Set children */ - ++GC_REFCOUNT(statement->connection->id); + GC_ADDREF(statement->connection->id); if (OCI_G(default_prefetch) >= 0) { php_oci_statement_set_prefetch(statement, (ub4)OCI_G(default_prefetch)); @@ -171,8 +171,8 @@ php_oci_statement *php_oci_get_implicit_resultset(php_oci_statement *statement) statement2->has_descr = 0; statement2->stmttype = 0; - GC_REFCOUNT(statement->id)++; - GC_REFCOUNT(statement2->connection->id)++; + GC_ADDREF(statement->id); + GC_ADDREF(statement2->connection->id); php_oci_statement_set_prefetch(statement2, statement->prefetch_count); @@ -433,7 +433,7 @@ sb4 php_oci_define_callback(dvoid *ctx, OCIDefine *define, ub4 iter, dvoid **buf return OCI_ERROR; } nested_stmt->parent_stmtid = outcol->statement->id; - ++GC_REFCOUNT(outcol->statement->id); + GC_ADDREF(outcol->statement->id); outcol->nested_statement = nested_stmt; outcol->stmtid = nested_stmt->id; diff --git a/ext/odbc/php_odbc.c b/ext/odbc/php_odbc.c index 010eaa6a18..be8fd12e11 100644 --- a/ext/odbc/php_odbc.c +++ b/ext/odbc/php_odbc.c @@ -2652,7 +2652,7 @@ try_and_get_another_connection: p = zend_hash_index_find_ptr(&EG(regular_list), conn_id); /* check if the connection is still there */ if (p && p->ptr && (p->type == le_conn || p->type == le_pconn)) { - GC_REFCOUNT(p)++; + GC_ADDREF(p); RETVAL_RES(p); efree(hashed_details); return; diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index 5e0ab19e57..02de091a58 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -471,7 +471,7 @@ zend_string *accel_new_interned_string(zend_string *str) p->key = (zend_string*) ZCSG(interned_strings_top); ZCSG(interned_strings_top) += ZEND_MM_ALIGNED_SIZE(_ZSTR_STRUCT_SIZE(ZSTR_LEN(str))); p->h = h; - GC_REFCOUNT(p->key) = 1; + GC_SET_REFCOUNT(p->key, 1); #if 1 /* optimized single assignment */ GC_TYPE_INFO(p->key) = IS_STRING | ((IS_STR_INTERNED | IS_STR_PERMANENT) << 8); diff --git a/ext/opcache/zend_accelerator_util_funcs.c b/ext/opcache/zend_accelerator_util_funcs.c index 6926798ab6..27e1a17f92 100644 --- a/ext/opcache/zend_accelerator_util_funcs.c +++ b/ext/opcache/zend_accelerator_util_funcs.c @@ -47,7 +47,7 @@ static void zend_accel_destroy_zend_function(zval *zv) if (function->type == ZEND_USER_FUNCTION) { if (function->op_array.static_variables) { if (!(GC_FLAGS(function->op_array.static_variables) & IS_ARRAY_IMMUTABLE)) { - if (--GC_REFCOUNT(function->op_array.static_variables) == 0) { + if (GC_DELREF(function->op_array.static_variables) == 0) { FREE_HASHTABLE(function->op_array.static_variables); } } diff --git a/ext/opcache/zend_persist.c b/ext/opcache/zend_persist.c index d2d943ddbb..a6792aa1ff 100644 --- a/ext/opcache/zend_persist.c +++ b/ext/opcache/zend_persist.c @@ -300,7 +300,7 @@ static void zend_persist_zval(zval *z) zend_hash_persist(Z_ARRVAL_P(z), zend_persist_zval); /* make immutable array */ Z_TYPE_FLAGS_P(z) = IS_TYPE_COPYABLE; - GC_REFCOUNT(Z_COUNTED_P(z)) = 2; + GC_SET_REFCOUNT(Z_COUNTED_P(z), 2); GC_FLAGS(Z_COUNTED_P(z)) |= IS_ARRAY_IMMUTABLE; Z_ARRVAL_P(z)->u.flags |= HASH_FLAG_STATIC_KEYS; } @@ -325,7 +325,7 @@ static void zend_persist_zval(zval *z) Z_ARR_P(z) = zend_accel_memdup(Z_AST_P(z), sizeof(zend_ast_ref)); zend_persist_ast(GC_AST(old_ref)); Z_TYPE_FLAGS_P(z) &= ~ (IS_TYPE_REFCOUNTED | IS_TYPE_COPYABLE); - GC_REFCOUNT(Z_COUNTED_P(z)) = 2; + GC_SET_REFCOUNT(Z_COUNTED_P(z), 2); efree(old_ref); } break; @@ -370,7 +370,7 @@ static void zend_persist_op_array_ex(zend_op_array *op_array, zend_persistent_sc zend_hash_persist(op_array->static_variables, zend_persist_zval); zend_accel_store(op_array->static_variables, sizeof(HashTable)); /* make immutable array */ - GC_REFCOUNT(op_array->static_variables) = 2; + GC_SET_REFCOUNT(op_array->static_variables, 2); GC_TYPE_INFO(op_array->static_variables) = IS_ARRAY | (IS_ARRAY_IMMUTABLE << 8); op_array->static_variables->u.flags |= HASH_FLAG_STATIC_KEYS; } diff --git a/ext/openssl/xp_ssl.c b/ext/openssl/xp_ssl.c index bb47f3965a..c7fe1730e9 100644 --- a/ext/openssl/xp_ssl.c +++ b/ext/openssl/xp_ssl.c @@ -2291,7 +2291,7 @@ static inline int php_openssl_tcp_sockop_accept(php_stream *stream, php_openssl_ if (xparam->outputs.client) { xparam->outputs.client->ctx = stream->ctx; if (stream->ctx) { - GC_REFCOUNT(stream->ctx)++; + GC_ADDREF(stream->ctx); } } diff --git a/ext/pdo/pdo_dbh.c b/ext/pdo/pdo_dbh.c index afca2d1cfb..be5f1e363f 100644 --- a/ext/pdo/pdo_dbh.c +++ b/ext/pdo/pdo_dbh.c @@ -367,7 +367,7 @@ static PHP_METHOD(PDO, dbh_constructor) le.type = php_pdo_list_entry(); le.ptr = dbh; - GC_REFCOUNT(&le) = 1; + GC_SET_REFCOUNT(&le, 1); if ((zend_hash_str_update_mem(&EG(persistent_list), (char*)dbh->persistent_id, dbh->persistent_id_len, &le, sizeof(le))) == NULL) { diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 246ea19a8d..fcb5ae664a 100644 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -246,8 +246,8 @@ static void get_lazy_object(pdo_stmt_t *stmt, zval *return_value) /* {{{ */ zend_object_std_init(&row->std, pdo_row_ce); ZVAL_OBJ(&stmt->lazy_object_ref, &row->std); row->std.handlers = &pdo_row_object_handlers; - GC_REFCOUNT(&stmt->std)++; - GC_REFCOUNT(&row->std)--; + GC_ADDREF(&stmt->std); + GC_DELREF(&row->std); } ZVAL_COPY(return_value, &stmt->lazy_object_ref); } diff --git a/ext/pdo_oci/oci_statement.c b/ext/pdo_oci/oci_statement.c index 306713bac3..2d64e242aa 100644 --- a/ext/pdo_oci/oci_statement.c +++ b/ext/pdo_oci/oci_statement.c @@ -691,7 +691,7 @@ static int oci_blob_close(php_stream *stream, int close_handle) OCILobClose(self->E->svc, self->E->err, self->lob); zval_ptr_dtor(&self->dbh); - GC_REFCOUNT(obj)--; + GC_DELREF(obj); efree(self->E); efree(self); } @@ -751,7 +751,7 @@ static php_stream *oci_create_lob_stream(zval *dbh, pdo_stmt_t *stmt, OCILobLoca zend_object *obj; obj = &stmt->std; Z_ADDREF(self->dbh); - GC_REFCOUNT(obj)++; + GC_ADDREF(obj); return stm; } diff --git a/ext/pdo_sqlite/sqlite_driver.c b/ext/pdo_sqlite/sqlite_driver.c index 1b4fecae81..e0627c1e32 100644 --- a/ext/pdo_sqlite/sqlite_driver.c +++ b/ext/pdo_sqlite/sqlite_driver.c @@ -346,7 +346,7 @@ static int do_callback(struct pdo_sqlite_fci *fc, zval *cb, ZVAL_NULL(&zargs[0]); } else { if (Z_ISUNDEF(agg_context->val)) { - GC_REFCOUNT(agg_context) = 1; + GC_SET_REFCOUNT(agg_context, 1); GC_TYPE_INFO(agg_context) = IS_REFERENCE; ZVAL_NULL(&agg_context->val); } diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index d9cb3ec301..f1bc779cfe 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -923,7 +923,7 @@ static inline char * _php_pgsql_trim_result(PGconn * pgsql, char **buf) */ static void php_pgsql_set_default_link(zend_resource *res) { - GC_REFCOUNT(res)++; + GC_ADDREF(res); if (PGG(default_link) != NULL) { zend_list_delete(PGG(default_link)); @@ -1451,7 +1451,7 @@ static void php_pgsql_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent) link = (zend_resource *)index_ptr->ptr; if (link->ptr && (link->type == le_link || link->type == le_plink)) { php_pgsql_set_default_link(link); - GC_REFCOUNT(link)++; + GC_ADDREF(link); RETVAL_RES(link); goto cleanup; } else { diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index f8073e9186..9b91a5a1c3 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1850,7 +1850,7 @@ ZEND_METHOD(reflection_function, getStaticVariables) array_init(return_value); if (GC_REFCOUNT(fptr->op_array.static_variables) > 1) { if (!(GC_FLAGS(fptr->op_array.static_variables) & IS_ARRAY_IMMUTABLE)) { - GC_REFCOUNT(fptr->op_array.static_variables)--; + GC_DELREF(fptr->op_array.static_variables); } fptr->op_array.static_variables = zend_array_dup(fptr->op_array.static_variables); } @@ -2278,7 +2278,7 @@ ZEND_METHOD(reflection_generator, getExecutingGenerator) REFLECTION_CHECK_VALID_GENERATOR(ex) current = zend_generator_get_current(generator); - ++GC_REFCOUNT(¤t->std); + GC_ADDREF(¤t->std); ZVAL_OBJ(return_value, (zend_object *) current); } diff --git a/ext/soap/php_http.c b/ext/soap/php_http.c index d8d8f95f2b..5315a3e0be 100644 --- a/ext/soap/php_http.c +++ b/ext/soap/php_http.c @@ -519,7 +519,7 @@ try_again: if (stream) { php_stream_auto_cleanup(stream); add_property_resource(this_ptr, "httpsocket", stream->res); - GC_REFCOUNT(stream->res)++; + GC_ADDREF(stream->res); add_property_long(this_ptr, "_use_proxy", use_proxy); } else { php_url_free(phpurl); @@ -539,7 +539,7 @@ try_again: zend_resource *ret = zend_register_resource(phpurl, le_url); add_property_resource(this_ptr, "httpurl", ret); - GC_REFCOUNT(ret)++; + GC_ADDREF(ret); /*zend_list_addref(ret);*/ if (context && @@ -1014,7 +1014,7 @@ try_again: } if (!zend_hash_index_exists(Z_ARRVAL(zcookie), 2)) { add_index_str(&zcookie, 2, phpurl->host); - GC_REFCOUNT(phpurl->host)++; + GC_ADDREF(phpurl->host); } zend_symtable_update(Z_ARRVAL_P(cookies), name.s, &zcookie); diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c index 672f40e469..f1c49f4db4 100644 --- a/ext/spl/spl_array.c +++ b/ext/spl/spl_array.c @@ -100,7 +100,7 @@ static inline HashTable **spl_array_get_hash_table_ptr(spl_array_object* intern) rebuild_object_properties(obj); } else if (GC_REFCOUNT(obj->properties) > 1) { if (EXPECTED(!(GC_FLAGS(obj->properties) & IS_ARRAY_IMMUTABLE))) { - GC_REFCOUNT(obj->properties)--; + GC_DELREF(obj->properties); } obj->properties = zend_array_dup(obj->properties); } @@ -1473,7 +1473,7 @@ static void spl_array_method(INTERNAL_FUNCTION_PARAMETERS, char *fname, int fnam ZVAL_NEW_EMPTY_REF(¶ms[0]); ZVAL_ARR(Z_REFVAL(params[0]), aht); - GC_REFCOUNT(aht)++; + GC_ADDREF(aht); if (!use_arg) { intern->nApplyCount++; @@ -1507,7 +1507,7 @@ exit: if (aht != new_ht) { spl_array_replace_hash_table(intern, new_ht); } else { - GC_REFCOUNT(aht)--; + GC_DELREF(aht); } efree(Z_REF(params[0])); zend_string_free(Z_STR(function_name)); diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index 64b80b6e02..41597e5f6b 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -1583,7 +1583,7 @@ static spl_dual_it_object* spl_dual_it_construct(INTERNAL_FUNCTION_PARAMETERS, z Z_ADDREF(cfi->fci.function_name); } cfi->object = cfi->fcc.object; - if (cfi->object) GC_REFCOUNT(cfi->object)++; + if (cfi->object) GC_ADDREF(cfi->object); intern->u.cbfilter = cfi; break; } diff --git a/ext/standard/array.c b/ext/standard/array.c index 2a0053ee8b..61c6837586 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -2567,7 +2567,7 @@ static void php_compact_var(HashTable *eg_active_symbol_table, zval *return_valu if (zend_string_equals_literal(Z_STR_P(entry), "this")) { zend_object *object = zend_get_this_object(EG(current_execute_data)); if (object) { - GC_REFCOUNT(object)++; + GC_ADDREF(object); ZVAL_OBJ(&data, object); zend_hash_update(Z_ARRVAL_P(return_value), Z_STR_P(entry), &data); } @@ -2659,7 +2659,7 @@ PHP_FUNCTION(array_fill) Z_ARRVAL_P(return_value)->nNextFreeElement = (zend_long)(start_key + num); if (Z_REFCOUNTED_P(val)) { - GC_REFCOUNT(Z_COUNTED_P(val)) += (uint32_t)num; + GC_ADDREF_EX(Z_COUNTED_P(val), (uint32_t)num); } p = Z_ARRVAL_P(return_value)->arData; @@ -2680,7 +2680,7 @@ PHP_FUNCTION(array_fill) array_init_size(return_value, (uint32_t)num); zend_hash_real_init(Z_ARRVAL_P(return_value), 0); if (Z_REFCOUNTED_P(val)) { - GC_REFCOUNT(Z_COUNTED_P(val)) += (uint32_t)num; + GC_ADDREF_EX(Z_COUNTED_P(val), (uint32_t)num); } zend_hash_index_add_new(Z_ARRVAL_P(return_value), start_key, val); while (--num) { @@ -4311,7 +4311,7 @@ PHP_FUNCTION(array_pad) num_pads = pad_size_abs - input_size; if (Z_REFCOUNTED_P(pad_value)) { - GC_REFCOUNT(Z_COUNTED_P(pad_value)) += num_pads; + GC_ADDREF_EX(Z_COUNTED_P(pad_value), num_pads); } array_init_size(return_value, pad_size_abs); diff --git a/ext/standard/dir.c b/ext/standard/dir.c index cc5c6d44ae..797ea1f701 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -113,7 +113,7 @@ static void php_set_default_dir(zend_resource *res) } if (res) { - GC_REFCOUNT(res)++; + GC_ADDREF(res); } DIRG(default_dir) = res; diff --git a/ext/standard/http_fopen_wrapper.c b/ext/standard/http_fopen_wrapper.c index 78131fbcc5..6e02743a5b 100644 --- a/ext/standard/http_fopen_wrapper.c +++ b/ext/standard/http_fopen_wrapper.c @@ -447,7 +447,7 @@ finish: if (ZSTR_IS_INTERNED(tmp)) { tmp = zend_string_init(ZSTR_VAL(tmp), ZSTR_LEN(tmp), 0); } else if (GC_REFCOUNT(tmp) > 1) { - GC_REFCOUNT(tmp)--; + GC_DELREF(tmp); tmp = zend_string_init(ZSTR_VAL(tmp), ZSTR_LEN(tmp), 0); } diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 539d2c5b69..90fa48b012 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -185,7 +185,7 @@ static void proc_open_rsrc_dtor(zend_resource *rsrc) /* Close all handles to avoid a deadlock */ for (i = 0; i < proc->npipes; i++) { if (proc->pipes[i] != 0) { - GC_REFCOUNT(proc->pipes[i])--; + GC_DELREF(proc->pipes[i]); zend_list_close(proc->pipes[i]); proc->pipes[i] = 0; } diff --git a/ext/standard/streamsfuncs.c b/ext/standard/streamsfuncs.c index b8d189d47d..3cb23b7165 100644 --- a/ext/standard/streamsfuncs.c +++ b/ext/standard/streamsfuncs.c @@ -208,7 +208,7 @@ PHP_FUNCTION(stream_socket_server) context = php_stream_context_from_zval(zcontext, flags & PHP_FILE_NO_DEFAULT_CONTEXT); if (context) { - GC_REFCOUNT(context->res)++; + GC_ADDREF(context->res); } if (zerrno) { @@ -1229,7 +1229,7 @@ static void apply_filter_to_stream(int append, INTERNAL_FUNCTION_PARAMETERS) if (filter) { filter->res = zend_register_resource(filter, php_file_le_stream_filter()); - GC_REFCOUNT(filter->res)++; + GC_ADDREF(filter->res); RETURN_RES(filter->res); } else { RETURN_FALSE; diff --git a/ext/xmlrpc/xmlrpc-epi-php.c b/ext/xmlrpc/xmlrpc-epi-php.c index 88f52519d0..cb727da38c 100644 --- a/ext/xmlrpc/xmlrpc-epi-php.c +++ b/ext/xmlrpc/xmlrpc-epi-php.c @@ -279,9 +279,9 @@ static void destroy_server_data(xmlrpc_server_data *server) static void xmlrpc_server_destructor(zend_resource *rsrc) { if (rsrc && rsrc->ptr) { - rsrc->gc.refcount++; + GC_ADDREF(rsrc); destroy_server_data((xmlrpc_server_data*) rsrc->ptr); - rsrc->gc.refcount--; + GC_DELREF(rsrc); } } |
