summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2003-08-18 22:31:29 +0000
committerZeev Suraski <zeev@php.net>2003-08-18 22:31:29 +0000
commit642e33130920dfd96735b92c5467771087099f6c (patch)
tree63c8f243a65be28128d900446fb279b0de861ec6
parent49c4866a4798716e40c6502dfb2edca7611edbfd (diff)
downloadphp-git-642e33130920dfd96735b92c5467771087099f6c.tar.gz
Improve tracking
-rw-r--r--main/main.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/main/main.c b/main/main.c
index 8131a891d5..ac25719838 100644
--- a/main/main.c
+++ b/main/main.c
@@ -867,10 +867,10 @@ static void php_message_handler_for_zend(long message, void *data)
break;
case ZMSG_MEMORY_LEAK_DETECTED:
case ZMSG_MEMORY_LEAK_REPEATED: {
+#if ZEND_DEBUG
TSRMLS_FETCH();
if ((EG(error_reporting)&E_WARNING) && PG(report_memleaks)) {
-#if ZEND_DEBUG
char memory_leak_buf[512];
if (message==ZMSG_MEMORY_LEAK_DETECTED) {
@@ -894,9 +894,26 @@ static void php_message_handler_for_zend(long message, void *data)
# else
fprintf(stderr, "%s", memory_leak_buf);
# endif
+ }
+ }
#endif
+ break;
+ case ZMSG_MEMORY_LEAKS_GRAND_TOTAL: {
+#if ZEND_DEBUG
+ TSRMLS_FETCH();
+
+ if ((EG(error_reporting)&E_WARNING) && PG(report_memleaks)) {
+ char memory_leak_buf[512];
+
+ snprintf(memory_leak_buf, 512, "=== Total %d memory leaks detected ===\n", *((zend_uint *) data));
+# if defined(PHP_WIN32)
+ OutputDebugString(memory_leak_buf);
+# else
+ fprintf(stderr, "%s", memory_leak_buf);
+# endif
}
}
+#endif
break;
case ZMSG_LOG_SCRIPT_NAME: {
struct tm *ta, tmbuf;