dmitry          Wed Dec 20 10:49:33 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src    NEWS 
    /ZendEngine2        Zend.m4 zend_alloc.c 
    /php-src/ext/standard       basic_functions.c php_var.h var.c 
    /php-src/main       main.c 
    /php-src/sapi/apache        mod_php5.c 
    /php-src/sapi/apache2filter sapi_apache2.c 
    /php-src/sapi/apache2handler        sapi_apache2.c 
    /php-src/sapi/apache_hooks  mod_php5.c 
    /php-src/win32/build        config.w32 
  Log:
  Make MEMORY_LIMIT and ZEND_USE_MALLOC_MM to be always enabled. They don't 
make any significant slowdown, but incrise maintainability a lot. Note that the 
setting of memory_limit wasn't changes (neither in main/main.c nor in php.ini) 
and it still set to 16M.
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.444&r2=1.2027.2.547.2.445&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.444 php-src/NEWS:1.2027.2.547.2.445
--- php-src/NEWS:1.2027.2.547.2.444     Wed Dec 20 10:34:36 2006
+++ php-src/NEWS        Wed Dec 20 10:49:32 2006
@@ -4,6 +4,7 @@
 - Added function stream_socket_shutdown(). It is a wraper for system shutdown()
   function, that shut downs part of a full-duplex connection. (Dmitry)
 - Added internal heap protection (Dmitry)
+  . memory-limit is always enabled (--enable-memory-limit removed)
   . safe unlinking
   . cookies
   . canary protection (debug build only)
http://cvs.php.net/viewvc.cgi/ZendEngine2/Zend.m4?r1=1.58.4.3&r2=1.58.4.4&diff_format=u
Index: ZendEngine2/Zend.m4
diff -u ZendEngine2/Zend.m4:1.58.4.3 ZendEngine2/Zend.m4:1.58.4.4
--- ZendEngine2/Zend.m4:1.58.4.3        Mon Dec 18 11:39:19 2006
+++ ZendEngine2/Zend.m4 Wed Dec 20 10:49:32 2006
@@ -1,5 +1,5 @@
 dnl
-dnl $Id: Zend.m4,v 1.58.4.3 2006/12/18 11:39:19 dmitry Exp $
+dnl $Id: Zend.m4,v 1.58.4.4 2006/12/20 10:49:32 dmitry Exp $
 dnl
 dnl This file contains Zend specific autoconf functions.
 dnl
@@ -129,13 +129,6 @@
   PHP_ZEND_VM=CALL
 ])
 
-AC_ARG_ENABLE(malloc-mm,
-[  --enable-malloc-mm      Use environment variable for run-time malloc/emalloc
-                          selection - FOR DEVELOPERS ONLY!!],
-[
-  ZEND_USE_MALLOC_MM=$enableval
-])
-
 AC_ARG_ENABLE(maintainer-zts,
 [  --enable-maintainer-zts Enable thread safety - for code maintainers 
only!!],[
   ZEND_MAINTAINER_ZTS=$enableval
@@ -151,13 +144,6 @@
   ZEND_INLINE_OPTIMIZATION=yes
 ])
 
-AC_ARG_ENABLE(memory-limit,
-[  --enable-memory-limit   Compile with memory limit support], [
-  ZEND_MEMORY_LIMIT=$enableval
-],[
-  ZEND_MEMORY_LIMIT=no
-])
-
 AC_ARG_ENABLE(zend-multibyte,
 [  --enable-zend-multibyte Compile with zend multibyte support], [
   ZEND_MULTIBYTE=$enableval
@@ -174,9 +160,6 @@
 AC_MSG_CHECKING(whether to enable inline optimization for GCC)
 AC_MSG_RESULT($ZEND_INLINE_OPTIMIZATION)
 
-AC_MSG_CHECKING(whether to enable a memory limit)
-AC_MSG_RESULT($ZEND_MEMORY_LIMIT)
-
 AC_MSG_CHECKING(whether to enable Zend debugging)
 AC_MSG_RESULT($ZEND_DEBUG)
 
@@ -217,12 +200,6 @@
   LIBZEND_CPLUSPLUS_CHECKS
 fi  
 
-if test "$ZEND_MEMORY_LIMIT" = "yes"; then
-  AC_DEFINE(MEMORY_LIMIT, 1, [Memory limit])
-else
-  AC_DEFINE(MEMORY_LIMIT, 0, [Memory limit])
-fi
-
 if test "$ZEND_MULTIBYTE" = "yes"; then
   AC_DEFINE(ZEND_MULTIBYTE, 1, [ ])
 fi
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_alloc.c?r1=1.144.2.3.2.26&r2=1.144.2.3.2.27&diff_format=u
Index: ZendEngine2/zend_alloc.c
diff -u ZendEngine2/zend_alloc.c:1.144.2.3.2.26 
ZendEngine2/zend_alloc.c:1.144.2.3.2.27
--- ZendEngine2/zend_alloc.c:1.144.2.3.2.26     Mon Dec 18 11:39:19 2006
+++ ZendEngine2/zend_alloc.c    Wed Dec 20 10:49:32 2006
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_alloc.c,v 1.144.2.3.2.26 2006/12/18 11:39:19 dmitry Exp $ */
+/* $Id: zend_alloc.c,v 1.144.2.3.2.27 2006/12/20 10:49:32 dmitry Exp $ */
 
 #include "zend.h"
 #include "zend_alloc.h"
@@ -38,11 +38,6 @@
 # include <process.h>
 #endif
 
-
-#ifndef ZEND_USE_MALLOC_MM
-# define ZEND_USE_MALLOC_MM ZEND_DEBUG
-#endif
-
 #ifndef ZEND_MM_HEAP_PROTECTION
 # define ZEND_MM_HEAP_PROTECTION ZEND_DEBUG
 #endif
@@ -372,16 +367,12 @@
        zend_mm_segment    *segments_list;
        zend_mm_storage    *storage;
        size_t                          real_size;
-#if MEMORY_LIMIT
        size_t              real_peak;
        size_t                          limit;
        size_t              size;
        size_t              peak;
        void               *reserve;
-#endif
-#if ZEND_USE_MALLOC_MM
        int                                     use_zend_alloc;
-#endif
        int                                     overflow;
 #if ZEND_MM_CACHE
        unsigned int        cached;
@@ -821,21 +812,15 @@
        heap->segments_list = NULL;
        zend_mm_init(heap);
 
-#if ZEND_USE_MALLOC_MM
        heap->use_zend_alloc = 1;
-#endif
-
        heap->real_size = 0;
        heap->overflow = 0;
-
-#if MEMORY_LIMIT
        heap->real_peak = 0;
        heap->limit = 1<<30;
        heap->size = 0;
        heap->peak = 0;
        heap->reserve = NULL;
        heap->reserve = zend_mm_alloc(heap, ZEND_MM_RESERVE_SIZE);
-#endif
 
        return heap;
 }
@@ -1248,12 +1233,10 @@
        zend_mm_segment *segment;
        zend_mm_segment *prev;
 
-#if MEMORY_LIMIT
        if (heap->reserve) {
                zend_mm_free(heap, heap->reserve);
                heap->reserve = NULL;
        }
-#endif
 
 #if ZEND_DEBUG
        if (!silent) {
@@ -1274,12 +1257,10 @@
                heap->segments_list = NULL;
                zend_mm_init(heap);
                heap->real_size = 0;
-#if MEMORY_LIMIT
                heap->real_peak = 0;
                heap->size = 0;
                heap->peak = 0;
                heap->reserve = zend_mm_alloc(heap, ZEND_MM_RESERVE_SIZE);
-#endif
                heap->overflow = 0;
        }
 }
@@ -1293,12 +1274,10 @@
 #endif
        size_t size)
 {
-#if MEMORY_LIMIT
        if (heap->reserve) {
                zend_mm_free(heap, heap->reserve);
                heap->reserve = NULL;
        }
-#endif
        if (heap->overflow == 0) {
                char *error_filename;
                uint error_lineno;
@@ -1454,7 +1433,6 @@
 
                HANDLE_BLOCK_INTERRUPTIONS();
 
-#if MEMORY_LIMIT
                if (heap->real_size + segment_size > heap->limit) {
                        /* Memory limit overflow */
 #if ZEND_MM_CACHE
@@ -1467,7 +1445,6 @@
                        zend_mm_safe_error(heap, "Allowed memory size of %d 
bytes exhausted (tried to allocate %d bytes)", heap->limit, size);
 #endif
                }
-#endif
 
                segment = (zend_mm_segment *) 
ZEND_MM_STORAGE_ALLOC(segment_size);
 
@@ -1486,11 +1463,9 @@
                }
 
                heap->real_size += segment_size;
-#if MEMORY_LIMIT
                if (heap->real_size > heap->real_peak) {
                        heap->real_peak = heap->real_size;
                }
-#endif
 
                segment->size = segment_size;
                segment->next_segment = heap->segments_list;
@@ -1522,12 +1497,10 @@
 
        ZEND_MM_SET_DEBUG_INFO(best_fit, size, 1, 1);
 
-#if MEMORY_LIMIT
        heap->size += true_size;
        if (heap->peak < heap->size) {
                heap->peak = heap->size;
        }
-#endif
 
        HANDLE_UNBLOCK_INTERRUPTIONS();
 
@@ -1567,9 +1540,7 @@
 
        HANDLE_BLOCK_INTERRUPTIONS();
 
-#if MEMORY_LIMIT
        heap->size -= size;
-#endif
 
        if (ZEND_MM_PREV_BLOCK_IS_FREE(mm_block)) {
                next_block = ZEND_MM_NEXT_BLOCK(mm_block);
@@ -1667,9 +1638,7 @@
 
                        /* add the new free block to the free list */
                        zend_mm_add_to_free_list(heap, new_free_block);
-#if MEMORY_LIMIT
                        heap->size += (true_size - orig_size);
-#endif
                        HANDLE_UNBLOCK_INTERRUPTIONS();
                }
                ZEND_MM_SET_DEBUG_INFO(mm_block, size, 0, 0);
@@ -1703,12 +1672,10 @@
                                zend_mm_add_to_free_list(heap, new_free_block);
                        }
                        ZEND_MM_SET_DEBUG_INFO(mm_block, size, 0, 0);
-#if MEMORY_LIMIT
                        heap->size = heap->size + true_size - orig_size;
                        if (heap->peak < heap->size) {
                                heap->peak = heap->size;
                        }
-#endif
                        HANDLE_UNBLOCK_INTERRUPTIONS();
                        return p;
                } else if (ZEND_MM_IS_FIRST_BLOCK(mm_block) &&
@@ -1735,7 +1702,6 @@
                }
 
                segment_copy = (zend_mm_segment *) ((char *)mm_block - 
ZEND_MM_ALIGNED_SEGMENT_SIZE);
-#if MEMORY_LIMIT
                if (heap->real_size + segment_size - segment_copy->size > 
heap->limit) {
 #if ZEND_MM_CACHE
                        zend_mm_free_cache(heap);
@@ -1748,7 +1714,7 @@
 #endif
                        return NULL;
                }
-#endif
+       
                segment = ZEND_MM_STORAGE_REALLOC(segment_copy, segment_size);
                if (!segment) {
 #if ZEND_MM_CACHE
@@ -1763,11 +1729,10 @@
                        return NULL;
                }
                heap->real_size += segment_size - segment->size;
-#if MEMORY_LIMIT
                if (heap->real_size > heap->real_peak) {
                        heap->real_peak = heap->real_size;
                }
-#endif
+
                segment->size = segment_size;
 
                if (segment != segment_copy) {
@@ -1810,12 +1775,12 @@
                }
 
                ZEND_MM_SET_DEBUG_INFO(mm_block, size, 1, 1);
-#if MEMORY_LIMIT
+
                heap->size = heap->size + true_size - orig_size;
                if (heap->peak < heap->size) {
                        heap->peak = heap->size;
                }
-#endif
+
                HANDLE_UNBLOCK_INTERRUPTIONS();
                return ZEND_MM_DATA_OF(mm_block);
        }
@@ -1879,22 +1844,16 @@
 
 ZEND_API int is_zend_mm(TSRMLS_D)
 {
-#if ZEND_USE_MALLOC_MM
        return AG(mm_heap)->use_zend_alloc;
-#else
-       return 1;
-#endif
 }
 
 ZEND_API void *_emalloc(size_t size ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
 {
        TSRMLS_FETCH();
 
-#if ZEND_USE_MALLOC_MM
        if (!AG(mm_heap)->use_zend_alloc) {
                return malloc(size);
        }
-#endif
        return _zend_mm_alloc_int(AG(mm_heap), size ZEND_FILE_LINE_RELAY_CC 
ZEND_FILE_LINE_ORIG_RELAY_CC);
 }
 
@@ -1902,12 +1861,10 @@
 {
        TSRMLS_FETCH();
 
-#if ZEND_USE_MALLOC_MM
        if (!AG(mm_heap)->use_zend_alloc) {
                free(ptr);
                return;
        }
-#endif
        _zend_mm_free_int(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC 
ZEND_FILE_LINE_ORIG_RELAY_CC);
 }
 
@@ -1915,21 +1872,17 @@
 {
        TSRMLS_FETCH();
 
-#if ZEND_USE_MALLOC_MM
        if (!AG(mm_heap)->use_zend_alloc) {
                return realloc(ptr, size);
        }
-#endif
        return _zend_mm_realloc_int(AG(mm_heap), ptr, size 
ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
 }
 
 ZEND_API size_t _zend_mem_block_size(void *ptr TSRMLS_DC ZEND_FILE_LINE_DC 
ZEND_FILE_LINE_ORIG_DC)
 {
-#if ZEND_USE_MALLOC_MM
        if (!AG(mm_heap)->use_zend_alloc) {
                return 0;
        }
-#endif
        return _zend_mm_block_size(AG(mm_heap), ptr ZEND_FILE_LINE_RELAY_CC 
ZEND_FILE_LINE_ORIG_RELAY_CC);
 }
 
@@ -2043,14 +1996,10 @@
 
 ZEND_API int zend_set_memory_limit(unsigned int memory_limit)
 {
-#if MEMORY_LIMIT
        TSRMLS_FETCH();
 
        AG(mm_heap)->limit = memory_limit;
        return SUCCESS;
-#else
-       return FAILURE;
-#endif
 }
 
 ZEND_API size_t zend_memory_usage(int real_usage TSRMLS_DC)
@@ -2058,25 +2007,17 @@
        if (real_usage) {
                return AG(mm_heap)->real_size;
        } else {
-#if MEMORY_LIMIT
                return AG(mm_heap)->size;
-#else
-               return AG(mm_heap)->real_size;
-#endif
        }
 }
 
 ZEND_API size_t zend_memory_peak_usage(int real_usage TSRMLS_DC)
 {
-#if MEMORY_LIMIT
        if (real_usage) {
                return AG(mm_heap)->real_peak;
        } else {
                return AG(mm_heap)->peak;
        }
-#else
-       return 0;
-#endif
 }
 
 ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC)
@@ -2086,15 +2027,13 @@
 
 static void alloc_globals_ctor(zend_alloc_globals *alloc_globals TSRMLS_DC)
 {
+       char *tmp;
        alloc_globals->mm_heap = zend_mm_startup();
-#if ZEND_USE_MALLOC_MM
-       {
-               char *tmp = getenv("USE_ZEND_ALLOC");
-               if (tmp) {
-                       alloc_globals->mm_heap->use_zend_alloc = zend_atoi(tmp, 
0);
-               }
+       
+       tmp = getenv("USE_ZEND_ALLOC");
+       if (tmp) {
+               alloc_globals->mm_heap->use_zend_alloc = zend_atoi(tmp, 0);
        }
-#endif
 }
 
 #ifdef ZTS
@@ -2128,11 +2067,9 @@
 {
        TSRMLS_FETCH();
 
-#if ZEND_USE_MALLOC_MM
        if (!AG(mm_heap)->use_zend_alloc) {
                return 1;
        }
-#endif
        return zend_mm_check_ptr(AG(mm_heap), ptr, silent 
ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
 }
 
@@ -2142,11 +2079,9 @@
        int errors;
        TSRMLS_FETCH();
 
-#if ZEND_USE_MALLOC_MM
        if (!AG(mm_heap)->use_zend_alloc) {
                return;
        }
-#endif
 
        
zend_debug_alloc_output("------------------------------------------------\n");
        zend_debug_alloc_output("Full Memory Check at %s:%d\n" 
ZEND_FILE_LINE_RELAY_CC);
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/basic_functions.c?r1=1.725.2.31.2.37&r2=1.725.2.31.2.38&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.725.2.31.2.37 
php-src/ext/standard/basic_functions.c:1.725.2.31.2.38
--- php-src/ext/standard/basic_functions.c:1.725.2.31.2.37      Wed Dec 20 
10:34:36 2006
+++ php-src/ext/standard/basic_functions.c      Wed Dec 20 10:49:32 2006
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: basic_functions.c,v 1.725.2.31.2.37 2006/12/20 10:34:36 bjori Exp $ */
+/* $Id: basic_functions.c,v 1.725.2.31.2.38 2006/12/20 10:49:32 dmitry Exp $ */
 
 #include "php.h"
 #include "php_streams.h"
@@ -3067,7 +3067,6 @@
        ZEND_ARG_INFO(0, variable_representation)
 ZEND_END_ARG_INFO()
 
-#if MEMORY_LIMIT
 static
 ZEND_BEGIN_ARG_INFO_EX(arginfo_memory_get_usage, 0, 0, 0)
        ZEND_ARG_INFO(0, real_usage)
@@ -3077,7 +3076,6 @@
 ZEND_BEGIN_ARG_INFO_EX(arginfo_memory_get_peak_usage, 0, 0, 0)
        ZEND_ARG_INFO(0, real_usage)
 ZEND_END_ARG_INFO()
-#endif
 /* }}} */
 /* {{{ versioning.c */
 static
@@ -3390,10 +3388,8 @@
        PHP_FE(var_export,                                                      
                                                        arginfo_var_export)
        PHP_FE(debug_zval_dump,                                                 
                                                arginfo_debug_zval_dump)
        PHP_FE(print_r,                                                         
                                                        arginfo_print_r)
-#if MEMORY_LIMIT 
        PHP_FE(memory_get_usage,                                                
                                                arginfo_memory_get_usage)
        PHP_FE(memory_get_peak_usage,                                           
                                        arginfo_memory_get_peak_usage)
-#endif
 
        PHP_FE(register_shutdown_function,                                      
                                        arginfo_register_shutdown_function)
        PHP_FE(register_tick_function,                                          
                                        arginfo_register_tick_function)
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/php_var.h?r1=1.30.2.1.2.3&r2=1.30.2.1.2.4&diff_format=u
Index: php-src/ext/standard/php_var.h
diff -u php-src/ext/standard/php_var.h:1.30.2.1.2.3 
php-src/ext/standard/php_var.h:1.30.2.1.2.4
--- php-src/ext/standard/php_var.h:1.30.2.1.2.3 Fri Dec  8 21:18:43 2006
+++ php-src/ext/standard/php_var.h      Wed Dec 20 10:49:32 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_var.h,v 1.30.2.1.2.3 2006/12/08 21:18:43 tony2001 Exp $ */
+/* $Id: php_var.h,v 1.30.2.1.2.4 2006/12/20 10:49:32 dmitry Exp $ */
 
 #ifndef PHP_VAR_H
 #define PHP_VAR_H
@@ -28,10 +28,8 @@
 PHP_FUNCTION(debug_zval_dump);
 PHP_FUNCTION(serialize);
 PHP_FUNCTION(unserialize);
-#if MEMORY_LIMIT 
 PHP_FUNCTION(memory_get_usage);
 PHP_FUNCTION(memory_get_peak_usage);
-#endif
 
 PHPAPI void php_var_dump(zval **struc, int level TSRMLS_DC);
 PHPAPI void php_var_export(zval **struc, int level TSRMLS_DC);
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/var.c?r1=1.203.2.7.2.11&r2=1.203.2.7.2.12&diff_format=u
Index: php-src/ext/standard/var.c
diff -u php-src/ext/standard/var.c:1.203.2.7.2.11 
php-src/ext/standard/var.c:1.203.2.7.2.12
--- php-src/ext/standard/var.c:1.203.2.7.2.11   Tue Dec 19 12:36:44 2006
+++ php-src/ext/standard/var.c  Wed Dec 20 10:49:32 2006
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: var.c,v 1.203.2.7.2.11 2006/12/19 12:36:44 tony2001 Exp $ */
+/* $Id: var.c,v 1.203.2.7.2.12 2006/12/20 10:49:32 dmitry Exp $ */
 
 
 
@@ -910,7 +910,6 @@
 
 /* }}} */
 
-#if MEMORY_LIMIT
 /* {{{ proto int memory_get_usage([real_usage])
     Returns the allocated by PHP memory */
 PHP_FUNCTION(memory_get_usage) {
@@ -923,6 +922,7 @@
        RETURN_LONG(zend_memory_usage(real_usage TSRMLS_CC));
 }
 /* }}} */
+
 /* {{{ proto int memory_get_peak_usage([real_usage])
     Returns the peak allocated by PHP memory */
 PHP_FUNCTION(memory_get_peak_usage) {
@@ -935,7 +935,6 @@
        RETURN_LONG(zend_memory_peak_usage(real_usage TSRMLS_CC));
 }
 /* }}} */
-#endif
 
 /*
  * Local variables:
http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.640.2.23.2.22&r2=1.640.2.23.2.23&diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640.2.23.2.22 php-src/main/main.c:1.640.2.23.2.23
--- php-src/main/main.c:1.640.2.23.2.22 Sun Dec 17 18:30:36 2006
+++ php-src/main/main.c Wed Dec 20 10:49:33 2006
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: main.c,v 1.640.2.23.2.22 2006/12/17 18:30:36 iliaa Exp $ */
+/* $Id: main.c,v 1.640.2.23.2.23 2006/12/20 10:49:33 dmitry Exp $ */
 
 /* {{{ includes
  */
@@ -105,7 +105,6 @@
 }
 /* }}} */
 
-#if MEMORY_LIMIT
 /* {{{ PHP_INI_MH
  */
 static PHP_INI_MH(OnChangeMemoryLimit)
@@ -118,7 +117,6 @@
        return zend_set_memory_limit(PG(memory_limit));
 }
 /* }}} */
-#endif
 
 
 /* {{{ php_disable_functions
@@ -311,9 +309,7 @@
        PHP_INI_ENTRY("SMTP",                                           
"localhost",PHP_INI_ALL,                NULL)
        PHP_INI_ENTRY("smtp_port",                                      "25",   
        PHP_INI_ALL,            NULL)
        PHP_INI_ENTRY("browscap",                                       NULL,   
        PHP_INI_SYSTEM,         NULL)
-#if MEMORY_LIMIT
        PHP_INI_ENTRY("memory_limit",                           "16M",          
PHP_INI_ALL,            OnChangeMemoryLimit)
-#endif
        PHP_INI_ENTRY("precision",                                      "14",   
        PHP_INI_ALL,            OnSetPrecision)
        PHP_INI_ENTRY("sendmail_from",                          NULL,           
PHP_INI_ALL,            NULL)
        PHP_INI_ENTRY("sendmail_path",  DEFAULT_SENDMAIL_PATH,  PHP_INI_SYSTEM, 
        NULL)
@@ -830,10 +826,8 @@
                case E_USER_ERROR:
                        EG(exit_status) = 255;
                        if (module_initialized) {
-#if MEMORY_LIMIT
                                /* restore memory limit */
                                zend_set_memory_limit(PG(memory_limit));
-#endif
                                efree(buffer);
                                
zend_objects_store_mark_destructed(&EG(objects_store) TSRMLS_CC);
                                zend_bailout();
http://cvs.php.net/viewvc.cgi/php-src/sapi/apache/mod_php5.c?r1=1.19.2.7.2.7&r2=1.19.2.7.2.8&diff_format=u
Index: php-src/sapi/apache/mod_php5.c
diff -u php-src/sapi/apache/mod_php5.c:1.19.2.7.2.7 
php-src/sapi/apache/mod_php5.c:1.19.2.7.2.8
--- php-src/sapi/apache/mod_php5.c:1.19.2.7.2.7 Fri Nov  3 13:51:47 2006
+++ php-src/sapi/apache/mod_php5.c      Wed Dec 20 10:49:33 2006
@@ -17,7 +17,7 @@
    | PHP 4.0 patches by Zeev Suraski <[EMAIL PROTECTED]>                      |
    +----------------------------------------------------------------------+
  */
-/* $Id: mod_php5.c,v 1.19.2.7.2.7 2006/11/03 13:51:47 iliaa Exp $ */
+/* $Id: mod_php5.c,v 1.19.2.7.2.8 2006/12/20 10:49:33 dmitry Exp $ */
 
 #include "php_apache_http.h"
 #include "http_conf_globals.h"
@@ -676,16 +676,10 @@
 static int send_parsed_php(request_rec * r)
 {
        int result = send_php(r, 0, NULL);
-
-#if MEMORY_LIMIT
-       {
-               char *mem_usage;
-               TSRMLS_FETCH();
+       TSRMLS_FETCH();
  
-               mem_usage = ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1 
TSRMLS_CC));
-               ap_table_setn(r->notes, "mod_php_memory_usage", mem_usage);
-       }
-#endif
+       ap_table_setn(r->notes, "mod_php_memory_usage",
+               ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1 
TSRMLS_CC)));
 
        return result;
 }
http://cvs.php.net/viewvc.cgi/php-src/sapi/apache2filter/sapi_apache2.c?r1=1.136.2.2.2.6&r2=1.136.2.2.2.7&diff_format=u
Index: php-src/sapi/apache2filter/sapi_apache2.c
diff -u php-src/sapi/apache2filter/sapi_apache2.c:1.136.2.2.2.6 
php-src/sapi/apache2filter/sapi_apache2.c:1.136.2.2.2.7
--- php-src/sapi/apache2filter/sapi_apache2.c:1.136.2.2.2.6     Wed Dec 13 
15:45:20 2006
+++ php-src/sapi/apache2filter/sapi_apache2.c   Wed Dec 20 10:49:33 2006
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: sapi_apache2.c,v 1.136.2.2.2.6 2006/12/13 15:45:20 iliaa Exp $ */
+/* $Id: sapi_apache2.c,v 1.136.2.2.2.7 2006/12/20 10:49:33 dmitry Exp $ */
 
 #include <fcntl.h>
 
@@ -442,10 +442,10 @@
        php_struct *ctx;
        void *conf = ap_get_module_config(f->r->per_dir_config, &php5_module);
        char *p = get_php_config(conf, "engine", sizeof("engine"));
-       TSRMLS_FETCH();
        zend_file_handle zfd;
        php_apr_bucket_brigade *pbb;
        apr_bucket *b;
+       TSRMLS_FETCH();
        
        if (f->r->proxyreq) {
                zend_try {
@@ -531,14 +531,8 @@
        
        php_execute_script(&zfd TSRMLS_CC);
 
-#if MEMORY_LIMIT
-       {
-               char *mem_usage;
-
-               mem_usage = apr_psprintf(ctx->r->pool, "%u", 
zend_memory_peak_usage(1 TSRMLS_CC));
-               apr_table_set(ctx->r->notes, "mod_php_memory_usage", mem_usage);
-       }
-#endif
+       apr_table_set(ctx->r->notes, "mod_php_memory_usage",
+               apr_psprintf(ctx->r->pool, "%u", zend_memory_peak_usage(1 
TSRMLS_CC)));
                
        php_apache_request_dtor(f TSRMLS_CC);
                
http://cvs.php.net/viewvc.cgi/php-src/sapi/apache2handler/sapi_apache2.c?r1=1.57.2.10.2.11&r2=1.57.2.10.2.12&diff_format=u
Index: php-src/sapi/apache2handler/sapi_apache2.c
diff -u php-src/sapi/apache2handler/sapi_apache2.c:1.57.2.10.2.11 
php-src/sapi/apache2handler/sapi_apache2.c:1.57.2.10.2.12
--- php-src/sapi/apache2handler/sapi_apache2.c:1.57.2.10.2.11   Wed Dec 13 
00:41:33 2006
+++ php-src/sapi/apache2handler/sapi_apache2.c  Wed Dec 20 10:49:33 2006
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: sapi_apache2.c,v 1.57.2.10.2.11 2006/12/13 00:41:33 iliaa Exp $ */
+/* $Id: sapi_apache2.c,v 1.57.2.10.2.12 2006/12/20 10:49:33 dmitry Exp $ */
 
 #define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
 
@@ -624,14 +624,9 @@
                } else {
                        zend_execute_scripts(ZEND_INCLUDE TSRMLS_CC, NULL, 1, 
&zfd);
                }
-#if MEMORY_LIMIT
-               {
-                       char *mem_usage;
 
-                       mem_usage = apr_psprintf(ctx->r->pool, "%u", 
zend_memory_peak_usage(1 TSRMLS_CC));
-                       apr_table_set(r->notes, "mod_php_memory_usage", 
mem_usage);
-               }
-#endif
+               apr_table_set(r->notes, "mod_php_memory_usage",
+                       apr_psprintf(ctx->r->pool, "%u", 
zend_memory_peak_usage(1 TSRMLS_CC)));
        }
 
 } zend_end_try();
http://cvs.php.net/viewvc.cgi/php-src/sapi/apache_hooks/mod_php5.c?r1=1.11.2.1.2.3&r2=1.11.2.1.2.4&diff_format=u
Index: php-src/sapi/apache_hooks/mod_php5.c
diff -u php-src/sapi/apache_hooks/mod_php5.c:1.11.2.1.2.3 
php-src/sapi/apache_hooks/mod_php5.c:1.11.2.1.2.4
--- php-src/sapi/apache_hooks/mod_php5.c:1.11.2.1.2.3   Thu Aug  3 09:56:50 2006
+++ php-src/sapi/apache_hooks/mod_php5.c        Wed Dec 20 10:49:33 2006
@@ -17,7 +17,7 @@
    | PHP 4.0 patches by Zeev Suraski <[EMAIL PROTECTED]>                       
                  |
    +----------------------------------------------------------------------+
  */
-/* $Id: mod_php5.c,v 1.11.2.1.2.3 2006/08/03 09:56:50 dmitry Exp $ */
+/* $Id: mod_php5.c,v 1.11.2.1.2.4 2006/12/20 10:49:33 dmitry Exp $ */
 
 #include "php_apache_http.h"
 
@@ -736,16 +736,10 @@
 static int send_parsed_php(request_rec * r)
 {
        int result = send_php(r, 0, NULL);
-
-#if MEMORY_LIMIT
-       {
-               char *mem_usage;
-               TSRMLS_FETCH();
+       TSRMLS_FETCH();
  
-               mem_usage = ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1 
TSRMLS_CC));
-               ap_table_setn(r->notes, "mod_php_memory_usage", mem_usage);
-       }
-#endif
+       ap_table_setn(r->notes, "mod_php_memory_usage",
+               ap_psprintf(r->pool, "%u", zend_memory_peak_usage(1 
TSRMLS_CC)));
 
        return result;
 }
http://cvs.php.net/viewvc.cgi/php-src/win32/build/config.w32?r1=1.40.2.8.2.6&r2=1.40.2.8.2.7&diff_format=u
Index: php-src/win32/build/config.w32
diff -u php-src/win32/build/config.w32:1.40.2.8.2.6 
php-src/win32/build/config.w32:1.40.2.8.2.7
--- php-src/win32/build/config.w32:1.40.2.8.2.6 Tue Dec 19 10:26:01 2006
+++ php-src/win32/build/config.w32      Wed Dec 20 10:49:33 2006
@@ -1,5 +1,5 @@
 // vim:ft=javascript
-// $Id: config.w32,v 1.40.2.8.2.6 2006/12/19 10:26:01 edink Exp $
+// $Id: config.w32,v 1.40.2.8.2.7 2006/12/20 10:49:33 dmitry Exp $
 // "Master" config file; think of it as a configure.in
 // equivalent.
 
@@ -297,14 +297,6 @@
 ARG_ENABLE('fd-setsize', "Set maximum number of sockets for select(2)", "256");
 ADD_FLAG("CFLAGS", "/D FD_SETSIZE=" + parseInt(PHP_FD_SETSIZE));
 
-ARG_ENABLE("memory-limit", "Enable memory limit checking code", "no");
-AC_DEFINE('MEMORY_LIMIT', PHP_MEMORY_LIMIT == "yes" ? 1 : 0);
-
-ARG_ENABLE("malloc-mm", "Use environment variable for run-time malloc/emalloc 
selection", "");
-if (PHP_MALLOC_MM.length) {
-       AC_DEFINE('ZEND_USE_MALLOC_MM', PHP_MALLOC_MM == "yes" ? 1 : 0);
-}
-
 ARG_ENABLE("zend-multibyte", "Enable Zend multibyte encoding support", "no");
 if (PHP_ZEND_MULTIBYTE == "yes") {
        STDOUT.WriteLine("Enabling Zend multibyte encoding support");

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to