andrey                                   Wed, 30 Sep 2009 23:13:43 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=289028

Log:
Use mnd_ wrappers wherever possible. Needed for
statistics.

Changed paths:
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_enum_n_def.h
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_palloc.c
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps_codec.c
    U   php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd.c
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_enum_n_def.h
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_palloc.c
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_ps_codec.c
    U   php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c	2009-09-30 22:26:19 UTC (rev 289027)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd.c	2009-09-30 23:13:43 UTC (rev 289028)
@@ -96,7 +96,7 @@
 		unsigned int i;
 		for (i = 0; i < conn->options.num_commands; i++) {
 			/* allocated with pestrdup */
-			pefree(conn->options.init_commands[i], pers);
+			mnd_pefree(conn->options.init_commands[i], pers);
 		}
 		mnd_pefree(conn->options.init_commands, pers);
 		conn->options.init_commands = NULL;
@@ -669,7 +669,12 @@

 	conn->greet_charset = mysqlnd_find_charset_nr(greet_packet.charset_no);
 	/* we allow load data local infile by default */
-	mysql_flags  |= CLIENT_LOCAL_FILES;
+	mysql_flags  |= CLIENT_LOCAL_FILES | CLIENT_PS_MULTI_RESULTS;
+#ifndef MYSQLND_COMPRESSION_ENABLED
+	if (mysql_flags & CLIENT_COMPRESS) {
+		mysql_flags &= ~CLIENT_COMPRESS;
+	}
+#endif

 	auth_packet->user		= user;
 	auth_packet->password	= passwd;

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_enum_n_def.h
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_enum_n_def.h	2009-09-30 22:26:19 UTC (rev 289027)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_enum_n_def.h	2009-09-30 23:13:43 UTC (rev 289028)
@@ -73,6 +73,7 @@
 #define CLIENT_SECURE_CONNECTION	32768	/* New 4.1 authentication */
 #define CLIENT_MULTI_STATEMENTS		(1UL << 16) /* Enable/disable multi-stmt support */
 #define CLIENT_MULTI_RESULTS		(1UL << 17) /* Enable/disable multi-results */
+#define CLIENT_PS_MULTI_RESULTS		(1UL << 18) /* Multi-results in PS-protocol */

 typedef enum mysqlnd_extension
 {

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_palloc.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_palloc.c	2009-09-30 22:26:19 UTC (rev 289027)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_palloc.c	2009-09-30 23:13:43 UTC (rev 289028)
@@ -42,7 +42,7 @@
 /* {{{ _mysqlnd_palloc_init_cache */
 PHPAPI MYSQLND_ZVAL_PCACHE* _mysqlnd_palloc_init_cache(unsigned int cache_size TSRMLS_DC)
 {
-	MYSQLND_ZVAL_PCACHE *ret = calloc(1, sizeof(MYSQLND_ZVAL_PCACHE));
+	MYSQLND_ZVAL_PCACHE *ret = mnd_calloc(1, sizeof(MYSQLND_ZVAL_PCACHE));
 	unsigned int i;

 	DBG_ENTER("_mysqlnd_palloc_init_cache");
@@ -58,13 +58,13 @@

 	/* 1. First initialize the free list part of the structure */
 	/* One more for empty position of last_added - always 0x0, bounds checking */
-	ret->free_list.ptr_line = calloc(ret->max_items + 1, sizeof(mysqlnd_zval *));
+	ret->free_list.ptr_line = mnd_calloc(ret->max_items + 1, sizeof(mysqlnd_zval *));
 	ret->free_list.last_added = ret->free_list.ptr_line + ret->max_items;
 	ret->free_list.canary1 = (void*)0xBEEF;
 	ret->free_list.canary2 = (void*)0xAFFE;

 	/* 3. Allocate and initialize our zvals and initialize the free list */
-	ret->block = calloc(ret->max_items, sizeof(mysqlnd_zval));
+	ret->block = mnd_calloc(ret->max_items, sizeof(mysqlnd_zval));
 	ret->last_in_block = &(ret->block[ret->max_items]);
 	for (i = 0; i < ret->max_items; i++) {
 		/* 1. Initialize */
@@ -124,7 +124,7 @@
 /* {{{ _mysqlnd_palloc_init_thd_cache */
 PHPAPI MYSQLND_THD_ZVAL_PCACHE* _mysqlnd_palloc_init_thd_cache(MYSQLND_ZVAL_PCACHE * const cache TSRMLS_DC)
 {
-	MYSQLND_THD_ZVAL_PCACHE *ret = calloc(1, sizeof(MYSQLND_THD_ZVAL_PCACHE));
+	MYSQLND_THD_ZVAL_PCACHE *ret = mnd_calloc(1, sizeof(MYSQLND_THD_ZVAL_PCACHE));
 	DBG_ENTER("_mysqlnd_palloc_init_thd_cache");
 	DBG_INF_FMT("ret = %p", ret);

@@ -146,7 +146,7 @@
 	ret->references = 1;

 	/* 1. Initialize the GC list */
-	ret->gc_list.ptr_line = calloc(cache->max_items, sizeof(mysqlnd_zval *));
+	ret->gc_list.ptr_line = mnd_calloc(cache->max_items, sizeof(mysqlnd_zval *));
 	/* Backward and forward looping is possible */
 	ret->gc_list.last_added = ret->gc_list.ptr_line;
 	ret->gc_list.canary1 = (void*)0xCAFE;

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c	2009-09-30 22:26:19 UTC (rev 289027)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c	2009-09-30 23:13:43 UTC (rev 289028)
@@ -1411,7 +1411,7 @@

 	if (stmt->param_count) {
 		if (!stmt->param_bind) {
-			stmt->param_bind = ecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND));
+			stmt->param_bind = mnd_ecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND));
 		}

 		/* Prevent from freeing */
@@ -1553,9 +1553,9 @@
 		mysqlnd_stmt_separate_one_result_bind(stmt, param_no TSRMLS_CC);
 		/* Guaranteed is that stmt->result_bind is NULL */
 		if (!stmt->result_bind) {
-			stmt->result_bind = ecalloc(stmt->field_count, sizeof(MYSQLND_RESULT_BIND));
+			stmt->result_bind = mnd_ecalloc(stmt->field_count, sizeof(MYSQLND_RESULT_BIND));
 		} else {
-			stmt->result_bind = erealloc(stmt->result_bind, stmt->field_count * sizeof(MYSQLND_RESULT_BIND));
+			stmt->result_bind = mnd_erealloc(stmt->result_bind, stmt->field_count * sizeof(MYSQLND_RESULT_BIND));
 		}
 		ALLOC_INIT_ZVAL(stmt->result_bind[param_no].zv);
 		/*
@@ -2179,7 +2179,7 @@
 PHPAPI void
 mysqlnd_efree_param_bind_dtor(MYSQLND_PARAM_BIND * param_bind)
 {
-	efree(param_bind);
+	mnd_efree(param_bind);
 }
 /* }}} */

@@ -2188,7 +2188,7 @@
 PHPAPI void
 mysqlnd_efree_result_bind_dtor(MYSQLND_RESULT_BIND * result_bind)
 {
-	efree(result_bind);
+	mnd_efree(result_bind);
 }
 /* }}} */


Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps_codec.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps_codec.c	2009-09-30 22:26:19 UTC (rev 289027)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps_codec.c	2009-09-30 23:13:43 UTC (rev 289028)
@@ -583,7 +583,7 @@
 mysqlnd_stmt_copy_it(zval *** copies, zval *original, unsigned int param_count, unsigned int current)
 {
 	if (!*copies) {
-		*copies = ecalloc(param_count, sizeof(zval *));
+		*copies = mnd_ecalloc(param_count, sizeof(zval *));
 	}
 	MAKE_STD_ZVAL((*copies)[current]);
 	*(*copies)[current] = *original;
@@ -777,7 +777,7 @@
 				zval_ptr_dtor(&copies[i]);
 			}
 		}
-		efree(copies);
+		mnd_efree(copies);
 	}
 }
 /* }}} */

Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c	2009-09-30 22:26:19 UTC (rev 289027)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_result.c	2009-09-30 23:13:43 UTC (rev 289028)
@@ -171,7 +171,7 @@
 											STAT_COPY_ON_WRITE_PERFORMED, 0);

 		/* Free last row's zvals */
-		efree(unbuf->last_row_data);
+		mnd_efree(unbuf->last_row_data);
 		unbuf->last_row_data = NULL;
 	}
 	if (unbuf->last_row_buffer) {
@@ -223,11 +223,11 @@
 	}
 	DBG_INF("Freeing data & row_buffer");
 	if (set->data) {
-		pefree(set->data, set->persistent);
+		mnd_pefree(set->data, set->persistent);
 		set->data = NULL;
 	}
 	if (set->row_buffers) {
-		pefree(set->row_buffers, set->persistent);
+		mnd_pefree(set->row_buffers, set->persistent);
 		set->row_buffers	= NULL;
 	}
 	set->data_cursor = NULL;
@@ -237,7 +237,7 @@
 	}

 	DBG_INF("Freeing set");
-	pefree(set, set->persistent);
+	mnd_pefree(set, set->persistent);

 	DBG_INF_FMT("after: real_usage=%lu  usage=%lu", zend_memory_usage(TRUE TSRMLS_CC), zend_memory_usage(FALSE TSRMLS_CC));
 	DBG_VOID_RETURN;
@@ -295,13 +295,13 @@
 #if MYSQLND_DEBUG_MEMORY
 			DBG_INF("Freeing current_row & current_buffer");
 #endif
-			pefree(current_row, set->persistent);
+			mnd_pefree(current_row, set->persistent);
 		}
 		current_buffer->free_chunk(current_buffer, TRUE TSRMLS_CC);
 	}
 	DBG_INF("Freeing data & row_buffer");
-	pefree(set->data, set->persistent);
-	pefree(set->row_buffers, set->persistent);
+	mnd_pefree(set->data, set->persistent);
+	mnd_pefree(set->row_buffers, set->persistent);
 	set->data			= NULL;
 	set->row_buffers	= NULL;
 	set->data_cursor	= NULL;
@@ -315,7 +315,7 @@
 	}

 	DBG_INF("Freeing set");
-	pefree(set, set->persistent);
+	mnd_pefree(set, set->persistent);

 	DBG_INF_FMT("after: real_usage=%lu  usage=%lu", zend_memory_usage(TRUE TSRMLS_CC), zend_memory_usage(FALSE TSRMLS_CC));
 	DBG_VOID_RETURN;
@@ -333,7 +333,7 @@

 	if (result->unbuf) {
 		mysqlnd_unbuffered_free_last_data(result TSRMLS_CC);
-		efree(result->unbuf);
+		mnd_efree(result->unbuf);
 		result->unbuf = NULL;
 	} else if (result->stored_data) {
 		mysqlnd_free_buffered_data(result TSRMLS_CC);
@@ -347,7 +347,7 @@
 #endif

 	if (result->lengths) {
-		efree(result->lengths);
+		mnd_efree(result->lengths);
 		result->lengths = NULL;
 	}

@@ -398,7 +398,7 @@
 		result->conn = NULL;
 	}

-	efree(result);
+	mnd_efree(result);

 	DBG_VOID_RETURN;
 }
@@ -575,7 +575,7 @@
 				if (FAIL == (ret = result->m.read_result_metadata(result, conn TSRMLS_CC))) {
 					/* For PS, we leave them in Prepared state */
 					if (!stmt) {
-						efree(conn->current_result);
+						mnd_efree(conn->current_result);
 						conn->current_result = NULL;
 					}
 					DBG_ERR("Error ocurred while reading metadata");
@@ -587,7 +587,7 @@
 				if (FAIL == (ret = PACKET_READ_ALLOCA(fields_eof, conn))) {
 					DBG_ERR("Error ocurred while reading the EOF packet");
 					result->m.free_result_contents(result TSRMLS_CC);
-					efree(result);
+					mnd_efree(result);
 					if (!stmt) {
 						conn->current_result = NULL;
 					} else {

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd.c	2009-09-30 22:26:19 UTC (rev 289027)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd.c	2009-09-30 23:13:43 UTC (rev 289028)
@@ -96,7 +96,7 @@
 		unsigned int i;
 		for (i = 0; i < conn->options.num_commands; i++) {
 			/* allocated with pestrdup */
-			pefree(conn->options.init_commands[i], pers);
+			mnd_pefree(conn->options.init_commands[i], pers);
 		}
 		mnd_pefree(conn->options.init_commands, pers);
 		conn->options.init_commands = NULL;
@@ -669,7 +669,12 @@

 	conn->greet_charset = mysqlnd_find_charset_nr(greet_packet.charset_no);
 	/* we allow load data local infile by default */
-	mysql_flags  |= CLIENT_LOCAL_FILES;
+	mysql_flags  |= CLIENT_LOCAL_FILES | CLIENT_PS_MULTI_RESULTS;
+#ifndef MYSQLND_COMPRESSION_ENABLED
+	if (mysql_flags & CLIENT_COMPRESS) {
+		mysql_flags &= ~CLIENT_COMPRESS;
+	}
+#endif

 	auth_packet->user		= user;
 	auth_packet->password	= passwd;

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_enum_n_def.h
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_enum_n_def.h	2009-09-30 22:26:19 UTC (rev 289027)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_enum_n_def.h	2009-09-30 23:13:43 UTC (rev 289028)
@@ -73,6 +73,7 @@
 #define CLIENT_SECURE_CONNECTION	32768	/* New 4.1 authentication */
 #define CLIENT_MULTI_STATEMENTS		(1UL << 16) /* Enable/disable multi-stmt support */
 #define CLIENT_MULTI_RESULTS		(1UL << 17) /* Enable/disable multi-results */
+#define CLIENT_PS_MULTI_RESULTS		(1UL << 18) /* Multi-results in PS-protocol */

 typedef enum mysqlnd_extension
 {

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_palloc.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_palloc.c	2009-09-30 22:26:19 UTC (rev 289027)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_palloc.c	2009-09-30 23:13:43 UTC (rev 289028)
@@ -42,7 +42,7 @@
 /* {{{ _mysqlnd_palloc_init_cache */
 PHPAPI MYSQLND_ZVAL_PCACHE* _mysqlnd_palloc_init_cache(unsigned int cache_size TSRMLS_DC)
 {
-	MYSQLND_ZVAL_PCACHE *ret = calloc(1, sizeof(MYSQLND_ZVAL_PCACHE));
+	MYSQLND_ZVAL_PCACHE *ret = mnd_calloc(1, sizeof(MYSQLND_ZVAL_PCACHE));
 	unsigned int i;

 	DBG_ENTER("_mysqlnd_palloc_init_cache");
@@ -58,13 +58,13 @@

 	/* 1. First initialize the free list part of the structure */
 	/* One more for empty position of last_added - always 0x0, bounds checking */
-	ret->free_list.ptr_line = calloc(ret->max_items + 1, sizeof(mysqlnd_zval *));
+	ret->free_list.ptr_line = mnd_calloc(ret->max_items + 1, sizeof(mysqlnd_zval *));
 	ret->free_list.last_added = ret->free_list.ptr_line + ret->max_items;
 	ret->free_list.canary1 = (void*)0xBEEF;
 	ret->free_list.canary2 = (void*)0xAFFE;

 	/* 3. Allocate and initialize our zvals and initialize the free list */
-	ret->block = calloc(ret->max_items, sizeof(mysqlnd_zval));
+	ret->block = mnd_calloc(ret->max_items, sizeof(mysqlnd_zval));
 	ret->last_in_block = &(ret->block[ret->max_items]);
 	for (i = 0; i < ret->max_items; i++) {
 		/* 1. Initialize */
@@ -124,7 +124,7 @@
 /* {{{ _mysqlnd_palloc_init_thd_cache */
 PHPAPI MYSQLND_THD_ZVAL_PCACHE* _mysqlnd_palloc_init_thd_cache(MYSQLND_ZVAL_PCACHE * const cache TSRMLS_DC)
 {
-	MYSQLND_THD_ZVAL_PCACHE *ret = calloc(1, sizeof(MYSQLND_THD_ZVAL_PCACHE));
+	MYSQLND_THD_ZVAL_PCACHE *ret = mnd_calloc(1, sizeof(MYSQLND_THD_ZVAL_PCACHE));
 	DBG_ENTER("_mysqlnd_palloc_init_thd_cache");
 	DBG_INF_FMT("ret = %p", ret);

@@ -146,7 +146,7 @@
 	ret->references = 1;

 	/* 1. Initialize the GC list */
-	ret->gc_list.ptr_line = calloc(cache->max_items, sizeof(mysqlnd_zval *));
+	ret->gc_list.ptr_line = mnd_calloc(cache->max_items, sizeof(mysqlnd_zval *));
 	/* Backward and forward looping is possible */
 	ret->gc_list.last_added = ret->gc_list.ptr_line;
 	ret->gc_list.canary1 = (void*)0xCAFE;

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c	2009-09-30 22:26:19 UTC (rev 289027)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_ps.c	2009-09-30 23:13:43 UTC (rev 289028)
@@ -1411,7 +1411,7 @@

 	if (stmt->param_count) {
 		if (!stmt->param_bind) {
-			stmt->param_bind = ecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND));
+			stmt->param_bind = mnd_ecalloc(stmt->param_count, sizeof(MYSQLND_PARAM_BIND));
 		}

 		/* Prevent from freeing */
@@ -1553,9 +1553,9 @@
 		mysqlnd_stmt_separate_one_result_bind(stmt, param_no TSRMLS_CC);
 		/* Guaranteed is that stmt->result_bind is NULL */
 		if (!stmt->result_bind) {
-			stmt->result_bind = ecalloc(stmt->field_count, sizeof(MYSQLND_RESULT_BIND));
+			stmt->result_bind = mnd_ecalloc(stmt->field_count, sizeof(MYSQLND_RESULT_BIND));
 		} else {
-			stmt->result_bind = erealloc(stmt->result_bind, stmt->field_count * sizeof(MYSQLND_RESULT_BIND));
+			stmt->result_bind = mnd_erealloc(stmt->result_bind, stmt->field_count * sizeof(MYSQLND_RESULT_BIND));
 		}
 		ALLOC_INIT_ZVAL(stmt->result_bind[param_no].zv);
 		/*
@@ -2179,7 +2179,7 @@
 PHPAPI void
 mysqlnd_efree_param_bind_dtor(MYSQLND_PARAM_BIND * param_bind)
 {
-	efree(param_bind);
+	mnd_efree(param_bind);
 }
 /* }}} */

@@ -2188,7 +2188,7 @@
 PHPAPI void
 mysqlnd_efree_result_bind_dtor(MYSQLND_RESULT_BIND * result_bind)
 {
-	efree(result_bind);
+	mnd_efree(result_bind);
 }
 /* }}} */


Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_ps_codec.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_ps_codec.c	2009-09-30 22:26:19 UTC (rev 289027)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_ps_codec.c	2009-09-30 23:13:43 UTC (rev 289028)
@@ -583,7 +583,7 @@
 mysqlnd_stmt_copy_it(zval *** copies, zval *original, unsigned int param_count, unsigned int current)
 {
 	if (!*copies) {
-		*copies = ecalloc(param_count, sizeof(zval *));
+		*copies = mnd_ecalloc(param_count, sizeof(zval *));
 	}
 	MAKE_STD_ZVAL((*copies)[current]);
 	*(*copies)[current] = *original;
@@ -777,7 +777,7 @@
 				zval_ptr_dtor(&copies[i]);
 			}
 		}
-		efree(copies);
+		mnd_efree(copies);
 	}
 }
 /* }}} */

Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c	2009-09-30 22:26:19 UTC (rev 289027)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_result.c	2009-09-30 23:13:43 UTC (rev 289028)
@@ -171,7 +171,7 @@
 											STAT_COPY_ON_WRITE_PERFORMED, 0);

 		/* Free last row's zvals */
-		efree(unbuf->last_row_data);
+		mnd_efree(unbuf->last_row_data);
 		unbuf->last_row_data = NULL;
 	}
 	if (unbuf->last_row_buffer) {
@@ -223,11 +223,11 @@
 	}
 	DBG_INF("Freeing data & row_buffer");
 	if (set->data) {
-		pefree(set->data, set->persistent);
+		mnd_pefree(set->data, set->persistent);
 		set->data = NULL;
 	}
 	if (set->row_buffers) {
-		pefree(set->row_buffers, set->persistent);
+		mnd_pefree(set->row_buffers, set->persistent);
 		set->row_buffers	= NULL;
 	}
 	set->data_cursor = NULL;
@@ -237,7 +237,7 @@
 	}

 	DBG_INF("Freeing set");
-	pefree(set, set->persistent);
+	mnd_pefree(set, set->persistent);

 	DBG_INF_FMT("after: real_usage=%lu  usage=%lu", zend_memory_usage(TRUE TSRMLS_CC), zend_memory_usage(FALSE TSRMLS_CC));
 	DBG_VOID_RETURN;
@@ -295,13 +295,13 @@
 #if MYSQLND_DEBUG_MEMORY
 			DBG_INF("Freeing current_row & current_buffer");
 #endif
-			pefree(current_row, set->persistent);
+			mnd_pefree(current_row, set->persistent);
 		}
 		current_buffer->free_chunk(current_buffer, TRUE TSRMLS_CC);
 	}
 	DBG_INF("Freeing data & row_buffer");
-	pefree(set->data, set->persistent);
-	pefree(set->row_buffers, set->persistent);
+	mnd_pefree(set->data, set->persistent);
+	mnd_pefree(set->row_buffers, set->persistent);
 	set->data			= NULL;
 	set->row_buffers	= NULL;
 	set->data_cursor	= NULL;
@@ -315,7 +315,7 @@
 	}

 	DBG_INF("Freeing set");
-	pefree(set, set->persistent);
+	mnd_pefree(set, set->persistent);

 	DBG_INF_FMT("after: real_usage=%lu  usage=%lu", zend_memory_usage(TRUE TSRMLS_CC), zend_memory_usage(FALSE TSRMLS_CC));
 	DBG_VOID_RETURN;
@@ -333,7 +333,7 @@

 	if (result->unbuf) {
 		mysqlnd_unbuffered_free_last_data(result TSRMLS_CC);
-		efree(result->unbuf);
+		mnd_efree(result->unbuf);
 		result->unbuf = NULL;
 	} else if (result->stored_data) {
 		mysqlnd_free_buffered_data(result TSRMLS_CC);
@@ -347,7 +347,7 @@
 #endif

 	if (result->lengths) {
-		efree(result->lengths);
+		mnd_efree(result->lengths);
 		result->lengths = NULL;
 	}

@@ -398,7 +398,7 @@
 		result->conn = NULL;
 	}

-	efree(result);
+	mnd_efree(result);

 	DBG_VOID_RETURN;
 }
@@ -575,7 +575,7 @@
 				if (FAIL == (ret = result->m.read_result_metadata(result, conn TSRMLS_CC))) {
 					/* For PS, we leave them in Prepared state */
 					if (!stmt) {
-						efree(conn->current_result);
+						mnd_efree(conn->current_result);
 						conn->current_result = NULL;
 					}
 					DBG_ERR("Error ocurred while reading metadata");
@@ -587,7 +587,7 @@
 				if (FAIL == (ret = PACKET_READ_ALLOCA(fields_eof, conn))) {
 					DBG_ERR("Error ocurred while reading the EOF packet");
 					result->m.free_result_contents(result TSRMLS_CC);
-					efree(result);
+					mnd_efree(result);
 					if (!stmt) {
 						conn->current_result = NULL;
 					} else {
-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to