cvs: ZendEngine2 / zend_alloc.c
| From: | Andi Gutmans | Date: | Mon, 24 Jun 2002 18:49:19 +0000 |
| Subject: | cvs: ZendEngine2 / zend_alloc.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-203@lists.php.net to get a copy of this message | ||
andi Mon Jun 24 14:49:19 2002 EDT
Modified files:
/ZendEngine2 zend_alloc.c
Log:
- More fixes (warnings, bug fixes etc.)
Index: ZendEngine2/zend_alloc.c
diff -u ZendEngine2/zend_alloc.c:1.107 ZendEngine2/zend_alloc.c:1.108
--- ZendEngine2/zend_alloc.c:1.107 Mon Jun 24 13:47:46 2002
+++ ZendEngine2/zend_alloc.c Mon Jun 24 14:49:13 2002
@@ -436,24 +436,15 @@
ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC)
{
zend_mem_header *p, *t;
- unsigned int fci, i, j;
+
#if ZEND_DEBUG
int had_leaks = 0;
#endif
- zend_fast_cache_list_entry *fast_cache_list_entry, *next_fast_cache_list_entry;
-#ifdef ZEND_MM
- if (clean_cache) {
- zend_mm_shutdown(&AG(mm_heap));
- }
- return;
-#elif defined(ZEND_WIN32) && !ZEND_DEBUG
- if (clean_cache && AG(memory_heap)) {
- HeapDestroy(AG(memory_heap));
- return;
- }
-#endif
#if ZEND_ENABLE_FAST_CACHE
+ zend_fast_cache_list_entry *fast_cache_list_entry, *next_fast_cache_list_entry;
+ unsigned int fci;
+
for (fci=0; fci<MAX_FAST_CACHE_TYPES; fci++) {
fast_cache_list_entry = AG(fast_cache_list_head)[fci];
while (fast_cache_list_entry) {
@@ -463,9 +454,11 @@
}
AG(fast_cache_list_head)[fci] = NULL;
}
-#endif
+#endif /* ZEND_ENABLE_FAST_CACHE */
+
#if !ZEND_DISABLE_MEMORY_CACHE
if (1 || clean_cache) {
+ unsigned int i, j;
zend_mem_header *ptr;
for (i=1; i<MAX_CACHED_MEMORY; i++) {
@@ -480,7 +473,8 @@
AG(cache_count)[i] = 0;
}
}
-#endif
+#endif /* !ZEND_DISABLE_MEMORY_CACHE */
+
#if ZEND_DEBUG || !defined(ZEND_MM)
p = AG(head);
t = AG(head);
@@ -566,8 +560,18 @@
}
} while (0);
+#endif
#endif
+
+#ifdef ZEND_MM
+ if (clean_cache) {
+ zend_mm_shutdown(&AG(mm_heap));
+ }
+#elif defined(ZEND_WIN32)
+ if (clean_cache && AG(memory_heap)) {
+ HeapDestroy(AG(memory_heap));
+ }
#endif
}