zeev Sun Feb 15 07:58:19 2004 EDT
Modified files:
/php-src/ext/com_dotnet com_saproxy.c
/php-src/ext/libxml libxml.c
/php-src/ext/mysqli mysqli.c
/php-src/ext/session session.c
Log:
Use zval_ptr_dtor() to free variables as soon as they hit refcount of 0.
Note: You should not be using ZVAL_DELREF() in day to day usage. Instead,
you should use zval_ptr_dtor(). Use ZVAL_DELREF() only if you're
messing with the refcount directly and know what you're doing.
Note #2: For clarity, if you want to initialize a new zval with a refcount
of 0, it's best to do that directly, instead of using ZVAL_DELREF
after allocating the zval...
http://cvs.php.net/diff.php/php-src/ext/com_dotnet/com_saproxy.c?r1=1.5&r2=1.6&ty=u
Index: php-src/ext/com_dotnet/com_saproxy.c
diff -u php-src/ext/com_dotnet/com_saproxy.c:1.5
php-src/ext/com_dotnet/com_saproxy.c:1.6
--- php-src/ext/com_dotnet/com_saproxy.c:1.5 Thu Feb 12 08:53:51 2004
+++ php-src/ext/com_dotnet/com_saproxy.c Sun Feb 15 07:58:17 2004
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: com_saproxy.c,v 1.5 2004/02/12 13:53:51 zeev Exp $ */
+/* $Id: com_saproxy.c,v 1.6 2004/02/15 12:58:17 zeev Exp $ */
/* This module implements a SafeArray proxy which is used internally
* by the engine when resolving multi-dimensional array accesses on
@@ -265,7 +265,7 @@
{
php_com_saproxy *proxy = (php_com_saproxy *)object;
- ZVAL_DELREF(proxy->zobj);
+ zval_ptr_dtor(&proxy->zobj);
efree(proxy->indices);
efree(proxy);
}
@@ -325,7 +325,7 @@
{
php_com_saproxy_iter *I = (php_com_saproxy_iter*)iter->data;
- ZVAL_DELREF(I->proxy_obj);
+ zval_ptr_dtor(&I->proxy_obj);
efree(I->indices);
efree(I);
http://cvs.php.net/diff.php/php-src/ext/libxml/libxml.c?r1=1.14&r2=1.15&ty=u
Index: php-src/ext/libxml/libxml.c
diff -u php-src/ext/libxml/libxml.c:1.14 php-src/ext/libxml/libxml.c:1.15
--- php-src/ext/libxml/libxml.c:1.14 Sat Jan 10 08:23:58 2004
+++ php-src/ext/libxml/libxml.c Sun Feb 15 07:58:17 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: libxml.c,v 1.14 2004/01/10 13:23:58 helly Exp $ */
+/* $Id: libxml.c,v 1.15 2004/02/15 12:58:17 zeev Exp $ */
#define IS_EXT_MODULE
@@ -466,7 +466,7 @@
return;
}
if (LIBXML(stream_context)) {
- ZVAL_DELREF(LIBXML(stream_context));
+ zval_ptr_dtor(&LIBXML(stream_context));
LIBXML(stream_context) = NULL;
}
ZVAL_ADDREF(arg);
http://cvs.php.net/diff.php/php-src/ext/mysqli/mysqli.c?r1=1.31&r2=1.32&ty=u
Index: php-src/ext/mysqli/mysqli.c
diff -u php-src/ext/mysqli/mysqli.c:1.31 php-src/ext/mysqli/mysqli.c:1.32
--- php-src/ext/mysqli/mysqli.c:1.31 Thu Feb 12 05:43:22 2004
+++ php-src/ext/mysqli/mysqli.c Sun Feb 15 07:58:18 2004
@@ -15,7 +15,7 @@
| Author: Georg Richter <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
- $Id: mysqli.c,v 1.31 2004/02/12 10:43:22 zeev Exp $
+ $Id: mysqli.c,v 1.32 2004/02/15 12:58:18 zeev Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -70,7 +70,7 @@
}
}
if (bbuf.vars[i]) {
- ZVAL_DELREF(bbuf.vars[i]);
+ zval_ptr_dtor(&bbuf.vars[i]);
}
}
http://cvs.php.net/diff.php/php-src/ext/session/session.c?r1=1.382&r2=1.383&ty=u
Index: php-src/ext/session/session.c
diff -u php-src/ext/session/session.c:1.382 php-src/ext/session/session.c:1.383
--- php-src/ext/session/session.c:1.382 Fri Jan 9 10:30:07 2004
+++ php-src/ext/session/session.c Sun Feb 15 07:58:19 2004
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: session.c,v 1.382 2004/01/09 15:30:07 wez Exp $ */
+/* $Id: session.c,v 1.383 2004/02/15 12:58:19 zeev Exp $ */
#ifdef HAVE_CONFIG_H
#include "config.h"
@@ -281,7 +281,7 @@
zval *empty_var;
ALLOC_INIT_ZVAL(empty_var); /* this sets refcount to 1 */
- ZVAL_DELREF(empty_var); /* our module does not maintain a ref
*/
+ empty_var->refcount = 0; /* our module does not maintain a ref
*/
/* The next call will increase refcount by NR_OF_SYM_TABLES==2
*/
zend_set_hash_symbol(empty_var, name, namelen, 1, 2,
Z_ARRVAL_P(PS(http_session_vars)), &EG(symbol_table));
} else if (sym_global == NULL) {
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php