summaryrefslogtreecommitdiff
path: root/Zend/zend_alloc.c
diff options
context:
space:
mode:
authorZeev Suraski <zeev@php.net>2003-08-18 22:31:11 +0000
committerZeev Suraski <zeev@php.net>2003-08-18 22:31:11 +0000
commit49c4866a4798716e40c6502dfb2edca7611edbfd (patch)
treef541f22b24cdcbdb41097f4efa9253ac767dbaa6 /Zend/zend_alloc.c
parent0dba58c373b3e96cf2fd064cc08de7f298d60e5f (diff)
downloadphp-git-49c4866a4798716e40c6502dfb2edca7611edbfd.tar.gz
- Improve tracking
- Fix several overloading issues
Diffstat (limited to 'Zend/zend_alloc.c')
-rw-r--r--Zend/zend_alloc.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index 0669f8942b..509af4a759 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -471,10 +471,7 @@ ZEND_API void start_memory_manager(TSRMLS_D)
ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC)
{
zend_mem_header *p, *t;
-
-#if ZEND_DEBUG
- int had_leaks = 0;
-#endif
+ zend_uint grand_total_leaks=0;
#if defined(ZEND_MM) && !ZEND_DEBUG
if (clean_cache) {
@@ -534,7 +531,7 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC)
zend_mem_header *iterator;
int total_leak=0, total_leak_count=0;
- had_leaks = 1;
+ grand_total_leaks++;
if (!silent) {
zend_message_dispatcher(ZMSG_MEMORY_LEAK_DETECTED, t);
}
@@ -565,6 +562,10 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC)
}
}
+ if (grand_total_leaks > 0) {
+ zend_message_dispatcher(ZMSG_MEMORY_LEAKS_GRAND_TOTAL, &grand_total_leaks);
+ }
+
#if MEMORY_LIMIT
AG(memory_exhausted)=0;
AG(allocated_memory_peak) = 0;