]> granicus.if.org Git - php/commitdiff
Warn about AiCount not zeroing out
authorZeev Suraski <zeev@php.net>
Sat, 22 May 1999 16:48:23 +0000 (16:48 +0000)
committerZeev Suraski <zeev@php.net>
Sat, 22 May 1999 16:48:23 +0000 (16:48 +0000)
Zend/zend_alloc.c

index 917f4949a3f5352447203236fceafb9b66bef8b7..e82948acf62a36074c8089cb47df2db09c1a73f8 100644 (file)
@@ -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
 }