From 49c4866a4798716e40c6502dfb2edca7611edbfd Mon Sep 17 00:00:00 2001 From: Zeev Suraski Date: Mon, 18 Aug 2003 22:31:11 +0000 Subject: - Improve tracking - Fix several overloading issues --- Zend/zend_alloc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Zend/zend_alloc.c') 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; -- cgit v1.2.1