com php-src: Use two dtors thus allow allocation based on the alloc model of the connection.: ext/date/php_date.c ext/mysqlnd/mysql nd.c
| From: | Andrey Hristov | Date: | Tue, 15 Jan 2013 11:19:52 +0000 |
| Subject: | com php-src: Use two dtors thus allow allocation based on the alloc model of the connection.: ext/date/php_date.c ext/mysqlnd/mysql nd.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-70976@lists.php.net to get a copy of this message | ||
Commit: acc24d1f9eb1f5dddc89123baca14e70be84be20
Author: Andrey Hristov <andrey@php.net> Tue, 15 Jan 2013 12:19:52 +0100
Parents: d377a266b27e0d0b2ac088333564f8d1f05cceb8
Branches: PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=acc24d1f9eb1f5dddc89123baca14e70be84be20
Log:
Use two dtors thus allow allocation based on the alloc model of the
connection.
Changed paths:
M ext/date/php_date.c
M ext/mysqlnd/mysqlnd.c
Diff:
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index cc83130..1e1e239 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -2071,7 +2071,7 @@ static zval* date_clone_immutable(zval *object)
zval *new_object;
ALLOC_ZVAL(new_object);
- Z_OBJVAL_P(new_object) = date_object_clone_date(object);
+// Z_OBJVAL_P(new_object) = date_object_clone_date(object);
Z_SET_REFCOUNT_P(new_object, 1);
Z_SET_ISREF_P(new_object);
Z_TYPE_P(new_object) = IS_OBJECT;
diff --git a/ext/mysqlnd/mysqlnd.c b/ext/mysqlnd/mysqlnd.c
index f5b1063..96c420d 100644
--- a/ext/mysqlnd/mysqlnd.c
+++ b/ext/mysqlnd/mysqlnd.c
@@ -2418,14 +2418,28 @@ end:
/* }}} */
-/* {{{ connect_attr_item_dtor */
+/* {{{ connect_attr_item_edtor */
static void
-connect_attr_item_dtor(void * pDest)
+connect_attr_item_edtor(void * pDest)
{
#ifdef ZTS
TSRMLS_FETCH();
#endif
- DBG_ENTER("connect_attr_item_dtor");
+ DBG_ENTER("connect_attr_item_edtor");
+ mnd_efree(*(char **) pDest);
+ DBG_VOID_RETURN;
+}
+/* }}} */
+
+
+/* {{{ connect_attr_item_pdtor */
+static void
+connect_attr_item_pdtor(void * pDest)
+{
+#ifdef ZTS
+ TSRMLS_FETCH();
+#endif
+ DBG_ENTER("connect_attr_item_pdtor");
mnd_pefree(*(char **) pDest, 1);
DBG_VOID_RETURN;
}
@@ -2456,11 +2470,11 @@ MYSQLND_METHOD(mysqlnd_conn_data, set_client_option_2d)(MYSQLND_CONN_DATA *
cons
if (!conn->options->connect_attr) {
goto oom;
}
- zend_hash_init(conn->options->connect_attr, 0, NULL, connect_attr_item_dtor,
conn->persistent);
+ zend_hash_init(conn->options->connect_attr, 0, NULL, conn->persistent?
connect_attr_item_pdtor:connect_attr_item_edtor, conn->persistent);
}
DBG_INF_FMT("Adding [%s][%s]", key, value);
{
- const char * copyv = mnd_pestrdup(value, 1);
+ const char * copyv = mnd_pestrdup(value, conn->persistent);
if (!copyv) {
goto oom;
}