diff options
-rw-r--r-- | ext/mysqlnd/mysqlnd_alloc.c | 2 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_palloc.c | 14 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_ps.c | 8 | ||||
-rw-r--r-- | ext/mysqlnd/mysqlnd_result.c | 10 |
4 files changed, 17 insertions, 17 deletions
diff --git a/ext/mysqlnd/mysqlnd_alloc.c b/ext/mysqlnd/mysqlnd_alloc.c index 9b3b819fcd..b37479b67e 100644 --- a/ext/mysqlnd/mysqlnd_alloc.c +++ b/ext/mysqlnd/mysqlnd_alloc.c @@ -174,7 +174,7 @@ void mysqlnd_alloc_cache_prealloc(MYSQLND_ZVAL_CACHE * const cache, unsigned int void mysqlnd_alloc_zval_ptr_dtor(zval **zv, MYSQLND_ZVAL_CACHE * const cache) { - if (!cache || ZVAL_REFCOUNT(*zv) > 1 || cache->max_items == cache->free_items) { + if (!cache || Z_REFCOUNT_PP(zv) > 1 || cache->max_items == cache->free_items) { #ifndef MYSQLND_SILENT php_printf("[mysqlnd_alloc_zval_ptr_dtor %p]1 last_added-1=%p *zv=%p\n", cache->free_list->last_added, *zv); #endif diff --git a/ext/mysqlnd/mysqlnd_palloc.c b/ext/mysqlnd/mysqlnd_palloc.c index fba769038a..d03af9cc18 100644 --- a/ext/mysqlnd/mysqlnd_palloc.c +++ b/ext/mysqlnd/mysqlnd_palloc.c @@ -76,7 +76,7 @@ PHPAPI MYSQLND_ZVAL_PCACHE* _mysqlnd_palloc_init_cache(unsigned int cache_size T INIT_PZVAL(&(ret->block[i].zv)); ZVAL_NULL(&(ret->block[i].zv)); /* Assure it will never be freed before MSHUTDOWN */ - ZVAL_ADDREF(&(ret->block[i].zv)); + Z_ADDREF_P(&(ret->block[i].zv)); /* 2. Add to the free list */ *(--ret->free_list.last_added) = &(ret->block[i]); } @@ -328,7 +328,7 @@ void *mysqlnd_palloc_get_zval(MYSQLND_THD_ZVAL_PCACHE * const thd_cache, zend_bo } else { /* This will set the refcount to 1, increase it, to keep the variable */ INIT_PZVAL(&((mysqlnd_zval *) ret)->zv); - ZVAL_ADDREF(&(((mysqlnd_zval *)ret)->zv)); + Z_ADDREF_P(&(((mysqlnd_zval *)ret)->zv)); } DBG_INF_FMT("allocated=%d ret=%p", *allocated, ret); @@ -347,7 +347,7 @@ void mysqlnd_palloc_zval_ptr_dtor(zval **zv, MYSQLND_THD_ZVAL_PCACHE * const thd thd_cache, thd_cache->parent? thd_cache->parent->block:NULL, thd_cache->parent? thd_cache->parent->last_in_block:NULL, - *zv, ZVAL_REFCOUNT(*zv), type); + *zv, Z_REFCOUNT_PP(zv), type); *copy_ctor_called = FALSE; /* Check whether cache is used and the zval is from the cache */ if (!thd_cache || !(cache = thd_cache->parent) || ((char *)*zv < (char *)thd_cache->parent->block || @@ -359,7 +359,7 @@ void mysqlnd_palloc_zval_ptr_dtor(zval **zv, MYSQLND_THD_ZVAL_PCACHE * const thd */ if (type == MYSQLND_RES_PS_BUF || type == MYSQLND_RES_PS_UNBUF) { ; /* do nothing, zval_ptr_dtor will do the job*/ - } else if (ZVAL_REFCOUNT(*zv) > 1) { + } else if (Z_REFCOUNT_PP(zv) > 1) { /* Not a prepared statement, then we have to call copy_ctor and then zval_ptr_dtor() @@ -388,8 +388,8 @@ void mysqlnd_palloc_zval_ptr_dtor(zval **zv, MYSQLND_THD_ZVAL_PCACHE * const thd } /* The zval is from our cache */ - /* refcount is always > 1, because we call ZVAL_ADDREF(). Thus test refcount > 2 */ - if (ZVAL_REFCOUNT(*zv) > 2) { + /* refcount is always > 1, because we call Z_ADDREF_P(). Thus test refcount > 2 */ + if (Z_REFCOUNT_PP(zv) > 2) { /* Because the zval is first element in mysqlnd_zval structure, then we can do upcasting from zval to mysqlnd_zval here. Because we know that this @@ -435,7 +435,7 @@ void mysqlnd_palloc_zval_ptr_dtor(zval **zv, MYSQLND_THD_ZVAL_PCACHE * const thd ++cache->put_hits; ++cache->free_items; ((mysqlnd_zval *)*zv)->point_type = MYSQLND_POINTS_FREE; - ZVAL_DELREF(*zv); /* Make it 1 */ + Z_DELREF_PP(zv); /* Make it 1 */ ZVAL_NULL(*zv); #ifdef ZTS memset(&((mysqlnd_zval *)*zv)->thread_id, 0, sizeof(THREAD_T)); diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index 00dc46761f..219da141c8 100644 --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@ -1149,7 +1149,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_param)(MYSQLND_STMT * const stmt, DBG_INF_FMT("%d is of type %d", i, stmt->param_bind[i].type); if (stmt->param_bind[i].type != MYSQL_TYPE_LONG_BLOB) { /* Prevent from freeing */ - ZVAL_ADDREF(stmt->param_bind[i].zv); + Z_ADDREF_P(stmt->param_bind[i].zv); /* Don't update is_ref, or we will leak during conversion */ } else { stmt->param_bind[i].zv = NULL; @@ -1197,7 +1197,7 @@ MYSQLND_METHOD(mysqlnd_stmt, bind_result)(MYSQLND_STMT * const stmt, stmt->result_bind = result_bind; for (i = 0; i < stmt->field_count; i++) { /* Prevent from freeing */ - ZVAL_ADDREF(stmt->result_bind[i].zv); + Z_ADDREF_P(stmt->result_bind[i].zv); /* Don't update is_ref !!! it's not our job Otherwise either 009.phpt or mysqli_stmt_bind_result.phpt @@ -1494,12 +1494,12 @@ void mysqlnd_stmt_separate_result_bind(MYSQLND_STMT * const stmt TSRMLS_DC) for (i = 0; i < stmt->field_count; i++) { /* Let's try with no cache */ if (stmt->result_bind[i].bound == TRUE) { - DBG_INF_FMT("%d has refcount=%u", i, ZVAL_REFCOUNT(stmt->result_bind[i].zv)); + DBG_INF_FMT("%d has refcount=%u", i, Z_REFCOUNT_P(stmt->result_bind[i].zv)); /* We have to separate the actual zval value of the bound variable from our allocated zvals or we will face double-free */ - if (ZVAL_REFCOUNT(stmt->result_bind[i].zv) > 1) { + if (Z_REFCOUNT_P(stmt->result_bind[i].zv) > 1) { #ifdef WE_DONT_COPY_IN_BUFFERED_AND_UNBUFFERED_BECAUSEOF_IS_REF zval_copy_ctor(stmt->result_bind[i].zv); #endif diff --git a/ext/mysqlnd/mysqlnd_result.c b/ext/mysqlnd/mysqlnd_result.c index 2d42d65469..80fcf531f6 100644 --- a/ext/mysqlnd/mysqlnd_result.c +++ b/ext/mysqlnd/mysqlnd_result.c @@ -539,10 +539,10 @@ mysqlnd_fetch_row_unbuffered(MYSQLND_RES *result, void *param, unsigned int flag } /* Forbid ZE to free it, we will clean it */ - ZVAL_ADDREF(data); + Z_ADDREF_P(data); if ((flags & MYSQLND_FETCH_BOTH) == MYSQLND_FETCH_BOTH) { - ZVAL_ADDREF(data); + Z_ADDREF_P(data); } if (flags & MYSQLND_FETCH_NUM) { zend_hash_next_index_insert(row_ht, &data, sizeof(zval *), NULL); @@ -671,10 +671,10 @@ mysqlnd_fetch_row_buffered(MYSQLND_RES *result, void *param, unsigned int flags, Let us later know what to do with this zval. If ref_count > 1, we will just decrease it, otherwise free it. zval_ptr_dtor() make this very easy job. */ - ZVAL_ADDREF(data); + Z_ADDREF_P(data); if ((flags & MYSQLND_FETCH_BOTH) == MYSQLND_FETCH_BOTH) { - ZVAL_ADDREF(data); + Z_ADDREF_P(data); } if (flags & MYSQLND_FETCH_NUM) { zend_hash_next_index_insert(Z_ARRVAL_P(row), &data, sizeof(zval *), NULL); @@ -1138,7 +1138,7 @@ MYSQLND_METHOD(mysqlnd_res, fetch_field_data)(MYSQLND_RES *result, unsigned int *return_value = **entry; zval_copy_ctor(return_value); - ZVAL_REFCOUNT(return_value) = 1; + Z_SET_REFCOUNT_P(return_value, 1); zval_dtor(&row); DBG_VOID_RETURN; |