dmitry Wed Dec 20 10:50:46 2006 UTC
Modified files:
/ZendEngine2 Zend.m4 zend_alloc.c
/php-src/ext/standard basic_functions.c php_var.h var.c
/php-src/main main.c output.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 a
ny 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/ZendEngine2/Zend.m4?r1=1.63&r2=1.64&diff_format=u
Index: ZendEngine2/Zend.m4
diff -u ZendEngine2/Zend.m4:1.63 ZendEngine2/Zend.m4:1.64
--- ZendEngine2/Zend.m4:1.63 Mon Dec 18 11:39:34 2006
+++ ZendEngine2/Zend.m4 Wed Dec 20 10:50:45 2006
@@ -1,5 +1,5 @@
dnl
-dnl $Id: Zend.m4,v 1.63 2006/12/18 11:39:34 dmitry Exp $
+dnl $Id: Zend.m4,v 1.64 2006/12/20 10:50:45 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_MSG_CHECKING([virtual machine dispatch method])
AC_MSG_RESULT($PHP_ZEND_VM)
@@ -167,9 +153,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)
@@ -207,12 +190,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
-
changequote({,})
if test -n "$GCC" && test "$ZEND_INLINE_OPTIMIZATION" != "yes"; then
INLINE_CFLAGS=`echo $ac_n "$CFLAGS $ac_c" | sed s/-O[0-9s]*//`
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_alloc.c?r1=1.177&r2=1.178&diff_format=u
Index: ZendEngine2/zend_alloc.c
diff -u ZendEngine2/zend_alloc.c:1.177 ZendEngine2/zend_alloc.c:1.178
--- ZendEngine2/zend_alloc.c:1.177 Mon Dec 18 11:39:34 2006
+++ ZendEngine2/zend_alloc.c Wed Dec 20 10:50:45 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_alloc.c,v 1.177 2006/12/18 11:39:34 dmitry Exp $ */
+/* $Id: zend_alloc.c,v 1.178 2006/12/20 10:50:45 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;
@@ -819,21 +810,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;
}
@@ -1246,12 +1231,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) {
@@ -1272,12 +1255,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;
}
}
@@ -1291,12 +1272,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;
@@ -1452,7 +1431,6 @@
HANDLE_BLOCK_INTERRUPTIONS();
-#if MEMORY_LIMIT
if (heap->real_size + segment_size > heap->limit) {
/* Memory limit overflow */
#if ZEND_MM_CACHE
@@ -1465,7 +1443,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);
@@ -1484,11 +1461,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;
@@ -1520,12 +1495,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();
@@ -1565,9 +1538,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);
@@ -1665,9 +1636,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);
@@ -1701,12 +1670,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) &&
@@ -1733,7 +1700,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);
@@ -1746,7 +1712,7 @@
#endif
return NULL;
}
-#endif
+
segment = ZEND_MM_STORAGE_REALLOC(segment_copy, segment_size);
if (!segment) {
#if ZEND_MM_CACHE
@@ -1761,11 +1727,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) {
@@ -1808,12 +1773,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);
}
@@ -1877,22 +1842,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);
}
@@ -1900,12 +1859,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);
}
@@ -1913,21 +1870,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);
}
@@ -2083,14 +2036,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)
@@ -2098,25 +2047,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
}
@@ -2127,15 +2068,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
@@ -2169,11 +2108,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);
}
@@ -2183,11 +2120,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.842&r2=1.843&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.842
php-src/ext/standard/basic_functions.c:1.843
--- php-src/ext/standard/basic_functions.c:1.842 Wed Dec 20 10:38:24 2006
+++ php-src/ext/standard/basic_functions.c Wed Dec 20 10:50:45 2006
@@ -17,7 +17,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: basic_functions.c,v 1.842 2006/12/20 10:38:24 bjori Exp $ */
+/* $Id: basic_functions.c,v 1.843 2006/12/20 10:50:45 dmitry Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -3109,7 +3109,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)
@@ -3119,7 +3118,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
@@ -3435,10 +3433,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.35&r2=1.36&diff_format=u
Index: php-src/ext/standard/php_var.h
diff -u php-src/ext/standard/php_var.h:1.35 php-src/ext/standard/php_var.h:1.36
--- php-src/ext/standard/php_var.h:1.35 Fri Dec 8 21:18:16 2006
+++ php-src/ext/standard/php_var.h Wed Dec 20 10:50:45 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_var.h,v 1.35 2006/12/08 21:18:16 tony2001 Exp $ */
+/* $Id: php_var.h,v 1.36 2006/12/20 10:50:45 dmitry Exp $ */
#ifndef PHP_VAR_H
#define PHP_VAR_H
@@ -29,10 +29,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, int verbose 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.253&r2=1.254&diff_format=u
Index: php-src/ext/standard/var.c
diff -u php-src/ext/standard/var.c:1.253 php-src/ext/standard/var.c:1.254
--- php-src/ext/standard/var.c:1.253 Tue Dec 19 12:44:26 2006
+++ php-src/ext/standard/var.c Wed Dec 20 10:50:45 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: var.c,v 1.253 2006/12/19 12:44:26 tony2001 Exp $ */
+/* $Id: var.c,v 1.254 2006/12/20 10:50:45 dmitry Exp $ */
@@ -1187,7 +1187,6 @@
/* }}} */
-#if MEMORY_LIMIT
/* {{{ proto int memory_get_usage([real_usage]) U
Returns the allocated by PHP memory */
PHP_FUNCTION(memory_get_usage) {
@@ -1200,6 +1199,7 @@
RETURN_LONG(zend_memory_usage(real_usage TSRMLS_CC));
}
/* }}} */
+
/* {{{ proto int memory_get_peak_usage([real_usage]) U
Returns the peak allocated by PHP memory */
PHP_FUNCTION(memory_get_peak_usage) {
@@ -1212,7 +1212,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.713&r2=1.714&diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.713 php-src/main/main.c:1.714
--- php-src/main/main.c:1.713 Sun Dec 17 18:30:50 2006
+++ php-src/main/main.c Wed Dec 20 10:50:45 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: main.c,v 1.713 2006/12/17 18:30:50 iliaa Exp $ */
+/* $Id: main.c,v 1.714 2006/12/20 10:50:45 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
@@ -409,9 +407,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)
@@ -929,10 +925,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/main/output.c?r1=1.202&r2=1.203&diff_format=u
Index: php-src/main/output.c
diff -u php-src/main/output.c:1.202 php-src/main/output.c:1.203
--- php-src/main/output.c:1.202 Sun Dec 10 15:02:50 2006
+++ php-src/main/output.c Wed Dec 20 10:50:45 2006
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: output.c,v 1.202 2006/12/10 15:02:50 mike Exp $ */
+/* $Id: output.c,v 1.203 2006/12/20 10:50:45 dmitry Exp $ */
#ifndef PHP_OUTPUT_DEBUG
# define PHP_OUTPUT_DEBUG 0
@@ -52,13 +52,8 @@
static inline int php_output_lock_error(int op TSRMLS_DC);
static inline void php_output_op(int op, const char *str, size_t len
TSRMLS_DC);
-#if MEMORY_LIMIT
#define php_output_handler_init(n, cs, f) php_output_handler_init_ex((n),
(cs), (f) TSRMLS_CC)
static inline php_output_handler *php_output_handler_init_ex(zval *name,
size_t chunk_size, int flags TSRMLS_DC);
-#else
-#define php_output_handler_init php_output_handler_init_ex
-static inline php_output_handler *php_output_handler_init_ex(zval *name,
size_t chunk_size, int flags);
-#endif
static inline php_output_handler_status_t
php_output_handler_op(php_output_handler *handler, php_output_context *context);
static inline int php_output_handler_append(php_output_handler *handler, const
php_output_buffer *buf TSRMLS_DC);
static inline zval *php_output_handler_status(php_output_handler *handler,
zval *entry);
@@ -889,29 +884,23 @@
/* {{{ static php_output_handler *php_output_handler_init(zval *name, size_t
chunk_size, int flags)
Allocates and initializes a php_output_handler structure */
-#if MEMORY_LIMIT
static inline php_output_handler *php_output_handler_init_ex(zval *name,
size_t chunk_size, int flags TSRMLS_DC)
-#else
-static inline php_output_handler *php_output_handler_init_ex(zval *name,
size_t chunk_size, int flags)
-#endif
{
php_output_handler *handler;
-#if MEMORY_LIMIT
size_t mem_limit;
-#endif
handler = ecalloc(1, sizeof(php_output_handler));
ZVAL_ADDREF(name);
handler->name = name;
-#if MEMORY_LIMIT
mem_limit = (PG(memory_limit) - zend_memory_usage(1 TSRMLS_CC)) / 2;
if (!chunk_size || chunk_size > mem_limit) {
handler->size = mem_limit;
chunk_size = 0;
- } else
-#endif
- handler->size = chunk_size;
+ } else {
+ handler->size = chunk_size;
+ }
+
handler->flags = flags;
handler->buffer.size = PHP_OUTPUT_HANDLER_INITBUF_SIZE(chunk_size);
handler->buffer.data = emalloc(handler->buffer.size);
http://cvs.php.net/viewvc.cgi/php-src/sapi/apache/mod_php5.c?r1=1.40&r2=1.41&diff_format=u
Index: php-src/sapi/apache/mod_php5.c
diff -u php-src/sapi/apache/mod_php5.c:1.40 php-src/sapi/apache/mod_php5.c:1.41
--- php-src/sapi/apache/mod_php5.c:1.40 Mon Oct 23 19:17:50 2006
+++ php-src/sapi/apache/mod_php5.c Wed Dec 20 10:50:46 2006
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski <[EMAIL PROTECTED]> |
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php5.c,v 1.40 2006/10/23 19:17:50 iliaa Exp $ */
+/* $Id: mod_php5.c,v 1.41 2006/12/20 10:50:46 dmitry Exp $ */
#include "php_apache_http.h"
#include "http_conf_globals.h"
@@ -661,16 +661,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.143&r2=1.144&diff_format=u
Index: php-src/sapi/apache2filter/sapi_apache2.c
diff -u php-src/sapi/apache2filter/sapi_apache2.c:1.143
php-src/sapi/apache2filter/sapi_apache2.c:1.144
--- php-src/sapi/apache2filter/sapi_apache2.c:1.143 Mon Oct 23 20:10:14 2006
+++ php-src/sapi/apache2filter/sapi_apache2.c Wed Dec 20 10:50:46 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sapi_apache2.c,v 1.143 2006/10/23 20:10:14 bjori Exp $ */
+/* $Id: sapi_apache2.c,v 1.144 2006/12/20 10:50:46 dmitry Exp $ */
#include <fcntl.h>
@@ -525,14 +525,9 @@
zfd.opened_path = NULL;
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)));
} else {
zend_syntax_highlighter_ini
syntax_highlighter_ini;
http://cvs.php.net/viewvc.cgi/php-src/sapi/apache2handler/sapi_apache2.c?r1=1.79&r2=1.80&diff_format=u
Index: php-src/sapi/apache2handler/sapi_apache2.c
diff -u php-src/sapi/apache2handler/sapi_apache2.c:1.79
php-src/sapi/apache2handler/sapi_apache2.c:1.80
--- php-src/sapi/apache2handler/sapi_apache2.c:1.79 Wed Dec 13 00:41:45 2006
+++ php-src/sapi/apache2handler/sapi_apache2.c Wed Dec 20 10:50:46 2006
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: sapi_apache2.c,v 1.79 2006/12/13 00:41:45 iliaa Exp $ */
+/* $Id: sapi_apache2.c,v 1.80 2006/12/20 10:50:46 dmitry Exp $ */
#define ZEND_INCLUDE_FULL_WINDOWS_HEADERS
@@ -619,14 +619,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.21&r2=1.22&diff_format=u
Index: php-src/sapi/apache_hooks/mod_php5.c
diff -u php-src/sapi/apache_hooks/mod_php5.c:1.21
php-src/sapi/apache_hooks/mod_php5.c:1.22
--- php-src/sapi/apache_hooks/mod_php5.c:1.21 Thu Aug 3 09:57:05 2006
+++ php-src/sapi/apache_hooks/mod_php5.c Wed Dec 20 10:50:46 2006
@@ -17,7 +17,7 @@
| PHP 4.0 patches by Zeev Suraski <[EMAIL PROTECTED]>
|
+----------------------------------------------------------------------+
*/
-/* $Id: mod_php5.c,v 1.21 2006/08/03 09:57:05 dmitry Exp $ */
+/* $Id: mod_php5.c,v 1.22 2006/12/20 10:50:46 dmitry Exp $ */
#include "php_apache_http.h"
@@ -721,16 +721,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.61&r2=1.62&diff_format=u
Index: php-src/win32/build/config.w32
diff -u php-src/win32/build/config.w32:1.61 php-src/win32/build/config.w32:1.62
--- php-src/win32/build/config.w32:1.61 Tue Dec 19 10:26:44 2006
+++ php-src/win32/build/config.w32 Wed Dec 20 10:50:46 2006
@@ -1,5 +1,5 @@
// vim:ft=javascript
-// $Id: config.w32,v 1.61 2006/12/19 10:26:44 edink Exp $
+// $Id: config.w32,v 1.62 2006/12/20 10:50:46 dmitry Exp $
// "Master" config file; think of it as a configure.in
// equivalent.
@@ -314,14 +314,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);
-}
-
AC_DEFINE('HAVE_USLEEP', 1);
AC_DEFINE('HAVE_STRCOLL', 1);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php