andrey Wed, 17 Aug 2011 11:15:55 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=315059
Log:
compile out when PHP_DEBUG is not present
Changed paths:
U php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_alloc.c
U php/php-src/trunk/ext/mysqlnd/mysqlnd_alloc.c
Modified: php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_alloc.c
===================================================================
--- php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_alloc.c 2011-08-17
10:59:32 UTC (rev 315058)
+++ php/php-src/branches/PHP_5_4/ext/mysqlnd/mysqlnd_alloc.c 2011-08-17
11:15:55 UTC (rev 315059)
@@ -78,7 +78,9 @@
{
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
+#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_emalloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_emalloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
@@ -111,7 +113,9 @@
{
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
+#if PHP_DEBUG
long * threshold = persistent?
&MYSQLND_G(debug_malloc_fail_threshold):&MYSQLND_G(debug_emalloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_pemalloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
@@ -146,7 +150,9 @@
{
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
+#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_ecalloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_ecalloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
DBG_INF_FMT("before: %lu", zend_memory_usage(FALSE TSRMLS_CC));
@@ -179,7 +185,9 @@
{
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
+#if PHP_DEBUG
long * threshold = persistent?
&MYSQLND_G(debug_calloc_fail_threshold):&MYSQLND_G(debug_ecalloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_pecalloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
@@ -215,7 +223,9 @@
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
size_t old_size = collect_memory_statistics && ptr? *(size_t *)
(((char*)ptr) - sizeof(size_t)) : 0;
+#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_erealloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_erealloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
DBG_INF_FMT("ptr=%p old_size=%lu, new_size=%lu", ptr, old_size,
new_size);
@@ -248,7 +258,9 @@
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
size_t old_size = collect_memory_statistics && ptr? *(size_t *)
(((char*)ptr) - sizeof(size_t)) : 0;
+#if PHP_DEBUG
long * threshold = persistent?
&MYSQLND_G(debug_realloc_fail_threshold):&MYSQLND_G(debug_erealloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_perealloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
DBG_INF_FMT("ptr=%p old_size=%lu new_size=%lu persistent=%u", ptr,
old_size, new_size, persistent);
@@ -333,7 +345,9 @@
{
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
+#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_malloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_malloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
@@ -364,7 +378,9 @@
{
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
+#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_calloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_calloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
@@ -395,7 +411,9 @@
{
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
+#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_realloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_realloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
DBG_INF_FMT("ptr=%p new_size=%lu ", new_size, ptr);
Modified: php/php-src/trunk/ext/mysqlnd/mysqlnd_alloc.c
===================================================================
--- php/php-src/trunk/ext/mysqlnd/mysqlnd_alloc.c 2011-08-17 10:59:32 UTC
(rev 315058)
+++ php/php-src/trunk/ext/mysqlnd/mysqlnd_alloc.c 2011-08-17 11:15:55 UTC
(rev 315059)
@@ -78,7 +78,9 @@
{
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
+#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_emalloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_emalloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
@@ -111,7 +113,9 @@
{
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
+#if PHP_DEBUG
long * threshold = persistent?
&MYSQLND_G(debug_malloc_fail_threshold):&MYSQLND_G(debug_emalloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_pemalloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
@@ -146,7 +150,9 @@
{
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
+#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_ecalloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_ecalloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
DBG_INF_FMT("before: %lu", zend_memory_usage(FALSE TSRMLS_CC));
@@ -179,7 +185,9 @@
{
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
+#if PHP_DEBUG
long * threshold = persistent?
&MYSQLND_G(debug_calloc_fail_threshold):&MYSQLND_G(debug_ecalloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_pecalloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
@@ -215,7 +223,9 @@
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
size_t old_size = collect_memory_statistics && ptr? *(size_t *)
(((char*)ptr) - sizeof(size_t)) : 0;
+#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_erealloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_erealloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
DBG_INF_FMT("ptr=%p old_size=%lu, new_size=%lu", ptr, old_size,
new_size);
@@ -248,7 +258,9 @@
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
size_t old_size = collect_memory_statistics && ptr? *(size_t *)
(((char*)ptr) - sizeof(size_t)) : 0;
+#if PHP_DEBUG
long * threshold = persistent?
&MYSQLND_G(debug_realloc_fail_threshold):&MYSQLND_G(debug_erealloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_perealloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
DBG_INF_FMT("ptr=%p old_size=%lu new_size=%lu persistent=%u", ptr,
old_size, new_size, persistent);
@@ -333,7 +345,9 @@
{
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
+#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_malloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_malloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
@@ -364,7 +378,9 @@
{
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
+#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_calloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_calloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
@@ -395,7 +411,9 @@
{
void *ret;
zend_bool collect_memory_statistics =
MYSQLND_G(collect_memory_statistics);
+#if PHP_DEBUG
long * threshold = &MYSQLND_G(debug_realloc_fail_threshold);
+#endif
DBG_ENTER(mysqlnd_realloc_name);
DBG_INF_FMT("file=%-15s line=%4d", strrchr(__zend_filename,
PHP_DIR_SEPARATOR) + 1, __zend_lineno);
DBG_INF_FMT("ptr=%p new_size=%lu ", new_size, ptr);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php