cvs: Zend / zend_alloc.c
| From: | Andi Gutmans | Date: | Mon, 24 Jun 2002 13:44:44 +0000 |
| Subject: | cvs: Zend / zend_alloc.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-197@lists.php.net to get a copy of this message | ||
andi Mon Jun 24 09:44:44 2002 EDT
Modified files:
/Zend zend_alloc.c
Log:
- Only do some initializations when needed
- Nuke some old commented code
Index: Zend/zend_alloc.c
diff -u Zend/zend_alloc.c:1.99 Zend/zend_alloc.c:1.100
--- Zend/zend_alloc.c:1.99 Sat Jun 22 10:25:27 2002
+++ Zend/zend_alloc.c Mon Jun 24 09:44:44 2002
@@ -369,13 +369,6 @@
ZEND_API void start_memory_manager(TSRMLS_D)
{
-#if 0
-#ifndef ZTS
- int i, j;
- void *cached_entries[MAX_CACHED_MEMORY][MAX_CACHED_ENTRIES];
-#endif
-#endif
-
AG(head) = NULL;
#if MEMORY_LIMIT
@@ -384,31 +377,15 @@
AG(memory_exhausted) = 0;
AG(allocated_memory_peak) = 0;
#endif
-
+#if ZEND_ENABLE_FAST_CACHE
memset(AG(fast_cache_list_head), 0, sizeof(AG(fast_cache_list_head)));
+#endif
+#if !ZEND_DISABLE_MEMORY_CACHE
memset(AG(cache_count), 0, sizeof(AG(cache_count)));
+#endif
#ifdef ZEND_WIN32
AG(memory_heap) = HeapCreate(HEAP_NO_SERIALIZE, 256*1024, 0);
-#endif
-
-#if 0
-#ifndef ZTS
- /* Initialize cache, to prevent fragmentation */
- /* We can't do this in ZTS mode, because calling emalloc() from within start_memory_manager()
- * will yield an endless recursion calling to alloc_globals_ctor()
- */
- for (i=1; i<MAX_CACHED_MEMORY; i++) {
- for (j=0; j<PRE_INIT_CACHE_ENTRIES; j++) {
- cached_entries[i][j] = emalloc(8*i);
- }
- }
- for (i=1; i<MAX_CACHED_MEMORY; i++) {
- for (j=0; j<PRE_INIT_CACHE_ENTRIES; j++) {
- efree(cached_entries[i][j]);
- }
- }
-#endif
#endif
#if ZEND_DEBUG