diff options
| author | Andi Gutmans <andi@php.net> | 2002-06-26 11:07:35 +0000 |
|---|---|---|
| committer | Andi Gutmans <andi@php.net> | 2002-06-26 11:07:35 +0000 |
| commit | b55a20abf42ebba89a8555169a81bcb7734efe76 (patch) | |
| tree | 74d421838db3a3709de241a6b7ff5b37f63510bc /Zend/zend_alloc.c | |
| parent | 1d5ab209ebb91eecdc9a384fe258c81c41b14b06 (diff) | |
| download | php-git-b55a20abf42ebba89a8555169a81bcb7734efe76.tar.gz | |
- 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.
Diffstat (limited to 'Zend/zend_alloc.c')
| -rw-r--r-- | Zend/zend_alloc.c | 40 |
1 files changed, 28 insertions, 12 deletions
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c index def9fa135c..c93317e75b 100644 --- a/Zend/zend_alloc.c +++ b/Zend/zend_alloc.c @@ -441,18 +441,32 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC) int had_leaks = 0; #endif +#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 + #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; + { + 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 @@ ZEND_API void shutdown_memory_manager(int silent, int clean_cache TSRMLS_DC) #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 } |
