From: Zeev Suraski Date: Sat, 22 May 1999 16:48:23 +0000 (+0000) Subject: Warn about AiCount not zeroing out X-Git-Tag: BEFORE_REMOVING_GC_STEP1~289 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=05f6cf54f0d30df63a137ee667bd06cce2c6a158;p=php Warn about AiCount not zeroing out --- diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index 917f4949a3..e82948acf6 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -344,6 +344,7 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache) char *last_filename = NULL; uint last_lineno = 0; uint leak_count=0, total_bytes=0; + unsigned char had_leaks=0; #endif ALS_FETCH(); @@ -353,6 +354,7 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache) if (!t->cached || clean_cache) { #if ZEND_DEBUG if (!t->cached) { + had_leaks = 1; if (last_filename != t->filename || last_lineno!=t->lineno) { /* flush old leak */ if (leak_count>0) { @@ -384,6 +386,13 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache) if (!silent && leak_count>1) { zend_message_dispatcher(ZMSG_MEMORY_LEAK_REPEATED, (void *) (leak_count-1)); } + if (had_leaks) { + ELS_FETCH(); + + if (EG(AiCount)!=0) { + fprintf(stderr, "AiCount did not zero out: %d\n", EG(AiCount)); + } + } #endif }