summaryrefslogtreecommitdiff
path: root/main/output.c
diff options
context:
space:
mode:
authorYiduo (David) Wang <davidw@php.net>2007-10-07 05:22:07 +0000
committerYiduo (David) Wang <davidw@php.net>2007-10-07 05:22:07 +0000
commit4b4d634cb956de1efc13c8ed9b243fe1a85f783b (patch)
treeeaa8d691de244aff3ee68fd3c23f769f02fa4446 /main/output.c
parentca4c55ad3a673257925bd9b458683c4f0e60e755 (diff)
downloadphp-git-4b4d634cb956de1efc13c8ed9b243fe1a85f783b.tar.gz
MFH: Added macros for managing zval refcounts and is_ref statuses
Diffstat (limited to 'main/output.c')
-rw-r--r--main/output.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/main/output.c b/main/output.c
index 5f36904c5e..b83eceff16 100644
--- a/main/output.c
+++ b/main/output.c
@@ -227,8 +227,8 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS
ALLOC_INIT_ZVAL(orig_buffer);
ZVAL_STRINGL(orig_buffer, OG(active_ob_buffer).buffer, OG(active_ob_buffer).text_length, 1);
- orig_buffer->refcount=2; /* don't let call_user_function() destroy our buffer */
- orig_buffer->is_ref=1;
+ Z_SET_REFCOUNT_P(orig_buffer, 2); /* don't let call_user_function() destroy our buffer */
+ Z_SET_ISREF_P(orig_buffer);
ALLOC_INIT_ZVAL(z_status);
ZVAL_LONG(z_status, status);
@@ -248,8 +248,8 @@ PHPAPI void php_end_ob_buffer(zend_bool send_buffer, zend_bool just_flush TSRMLS
if (!just_flush) {
zval_ptr_dtor(&OG(active_ob_buffer).output_handler);
}
- orig_buffer->refcount -=2;
- if (orig_buffer->refcount <= 0) { /* free the zval */
+ Z_SET_REFCOUNT_P(orig_buffer, Z_REFCOUNT_P(orig_buffer) - 2);
+ if (Z_REFCOUNT_P(orig_buffer) <= 0) { /* free the zval */
zval_dtor(orig_buffer);
FREE_ZVAL(orig_buffer);
}
@@ -510,7 +510,7 @@ static int php_ob_init(uint initial_size, uint block_size, zval *output_handler,
/* do we have array(object,method) */
if (zend_is_callable(output_handler, 0, &handler_name)) {
SEPARATE_ZVAL(&output_handler);
- output_handler->refcount++;
+ Z_ADDREF_P(output_handler);
result = php_ob_init_named(initial_size, block_size, handler_name, output_handler, chunk_size, erase TSRMLS_CC);
efree(handler_name);
} else {