cvs: ZendEngine2 / zend_alloc.c zend_execute.c
| From: | Andi Gutmans | Date: | Wed, 26 Jun 2002 11:07:37 +0000 |
| Subject: | cvs: ZendEngine2 / zend_alloc.c zend_execute.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-206@lists.php.net to get a copy of this message | ||
andi Wed Jun 26 07:07:37 2002 EDT
Modified files:
/ZendEngine2 zend_execute.c zend_alloc.c
Log:
- Fix problem with scope's not changing correctly during method calls.
- Reapply a tiny optimization to the allocator so that in non-debug mode
- we clean memory without detecting leaks.
Index: ZendEngine2/zend_execute.c
diff -u ZendEngine2/zend_execute.c:1.348 ZendEngine2/zend_execute.c:1.349
--- ZendEngine2/zend_execute.c:1.348 Mon Jun 24 13:58:22 2002
+++ ZendEngine2/zend_execute.c Wed Jun 26 07:07:35 2002
@@ -1939,7 +1939,7 @@
}
if(EX(fbc)->type == ZEND_USER_FUNCTION) {
- EX(calling_scope) = Z_OBJCE_P(EX(object));
+ EX(calling_scope) = EX(fbc)->common.scope;
} else {
EX(calling_scope) = NULL;
}
Index: ZendEngine2/zend_alloc.c
diff -u ZendEngine2/zend_alloc.c:1.108 ZendEngine2/zend_alloc.c:1.109
--- ZendEngine2/zend_alloc.c:1.108 Mon Jun 24 14:49:13 2002
+++ ZendEngine2/zend_alloc.c Wed Jun 26 07:07:35 2002
@@ -441,18 +441,32 @@
int had_leaks = 0;
#endif
-#if ZEND_ENABLE_FAST_CACHE
- zend_fast_cache_list_entry *fast_cache_list_entry, *next_fast_cache_list_entry;
- unsigned int fci;
+#if defined(ZEND_MM) && !ZEND_DEBUG
+ 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
- for (fci=0; fci<MAX_FAST_CACHE_TYPES; fci++) {
- fast_cache_list_entry = AG(fast_cache_list_head)[fci];
- while (fast_cache_list_entry) {
- next_fast_cache_list_entry = fast_cache_list_entry->next;
- efree(fast_cache_list_entry);
- fast_cache_list_entry = next_fast_cache_list_entry;
+#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) {
+ next_fast_cache_list_entry = fast_cache_list_entry->next;
+ efree(fast_cache_list_entry);
+ fast_cache_list_entry = next_fast_cache_list_entry;
+ }
+ AG(fast_cache_list_head)[fci] = NULL;
}
- AG(fast_cache_list_head)[fci] = NULL;
}
#endif /* ZEND_ENABLE_FAST_CACHE */
@@ -564,13 +578,15 @@
#endif
-#ifdef ZEND_MM
+#if defined(ZEND_MM) && ZEND_DEBUG
if (clean_cache) {
zend_mm_shutdown(&AG(mm_heap));
+ return;
}
-#elif defined(ZEND_WIN32)
+#elif defined(ZEND_WIN32) && ZEND_DEBUG
if (clean_cache && AG(memory_heap)) {
HeapDestroy(AG(memory_heap));
+ return;
}
#endif
}