summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--Zend/Zend.m423
-rw-r--r--Zend/zend_alloc.c83
-rw-r--r--ext/standard/basic_functions.c4
-rw-r--r--ext/standard/php_var.h2
-rw-r--r--ext/standard/var.c3
-rw-r--r--main/main.c6
-rw-r--r--sapi/apache/mod_php5.c12
-rw-r--r--sapi/apache2filter/sapi_apache2.c12
-rw-r--r--sapi/apache2handler/sapi_apache2.c9
-rw-r--r--sapi/apache_hooks/mod_php5.c12
-rw-r--r--win32/build/config.w328
12 files changed, 22 insertions, 153 deletions
diff --git a/NEWS b/NEWS
index d01437f..2bad00e 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,7 @@ PHP NEWS
- 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)
diff --git a/Zend/Zend.m4 b/Zend/Zend.m4
index 3ef1bc2..8f34bdf 100644
--- a/Zend/Zend.m4
+++ b/Zend/Zend.m4
@@ -129,13 +129,6 @@ AC_ARG_WITH(zend-vm,
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 @@ AC_ARG_ENABLE(inline-optimization,
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_RESULT($ZEND_MAINTAINER_ZTS)
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 @@ if test "$ZEND_MAINTAINER_ZTS" = "yes"; then
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
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index d21e2cb..25a7c60 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -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 @@ struct _zend_mm_heap {
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 @@ ZEND_API zend_mm_heap *zend_mm_startup_ex(const zend_mm_mem_handlers *handlers,
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_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent
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 @@ ZEND_API void zend_mm_shutdown(zend_mm_heap *heap, int full_shutdown, int silent
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 @@ static void zend_mm_safe_error(zend_mm_heap *heap,
#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 @@ zend_mm_finished_searching_for_block:
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_finished_searching_for_block:
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 @@ zend_mm_finished_searching_for_block:
}
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_finished_searching_for_block:
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 @@ static void _zend_mm_free_int(zend_mm_heap *heap, void *p ZEND_FILE_LINE_DC ZEND
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 @@ static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_
/* 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 @@ static void *_zend_mm_realloc_int(zend_mm_heap *heap, void *p, size_t size ZEND_
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 @@ realloc_segment:
}
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 @@ realloc_segment:
#endif
return NULL;
}
-#endif
+
segment = ZEND_MM_STORAGE_REALLOC(segment_copy, segment_size);
if (!segment) {
#if ZEND_MM_CACHE
@@ -1763,11 +1729,10 @@ realloc_segment:
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 @@ realloc_segment:
}
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 @@ static zend_alloc_globals alloc_globals;
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 @@ ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
{
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 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
{
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 char *zend_strndup(const char *s, uint length)
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 @@ ZEND_API size_t zend_memory_usage(int real_usage TSRMLS_DC)
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 @@ ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC)
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 @@ ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_
{
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 @@ ZEND_API void _full_mem_check(int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_D
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);
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index 3bb2c8f..68fdafb 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -3067,7 +3067,6 @@ ZEND_BEGIN_ARG_INFO(arginfo_unserialize, 0)
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 @@ static
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 @@ zend_function_entry basic_functions[] = {
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)
diff --git a/ext/standard/php_var.h b/ext/standard/php_var.h
index 42f1be5..dc699bd 100644
--- a/ext/standard/php_var.h
+++ b/ext/standard/php_var.h
@@ -28,10 +28,8 @@ PHP_FUNCTION(var_export);
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);
diff --git a/ext/standard/var.c b/ext/standard/var.c
index e71558c..64be626 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -910,7 +910,6 @@ PHP_FUNCTION(unserialize)
/* }}} */
-#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 @@ PHP_FUNCTION(memory_get_usage) {
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 @@ PHP_FUNCTION(memory_get_peak_usage) {
RETURN_LONG(zend_memory_peak_usage(real_usage TSRMLS_CC));
}
/* }}} */
-#endif
/*
* Local variables:
diff --git a/main/main.c b/main/main.c
index 81d803e..f9f21ae 100644
--- a/main/main.c
+++ b/main/main.c
@@ -105,7 +105,6 @@ static PHP_INI_MH(OnSetPrecision)
}
/* }}} */
-#if MEMORY_LIMIT
/* {{{ PHP_INI_MH
*/
static PHP_INI_MH(OnChangeMemoryLimit)
@@ -118,7 +117,6 @@ static PHP_INI_MH(OnChangeMemoryLimit)
return zend_set_memory_limit(PG(memory_limit));
}
/* }}} */
-#endif
/* {{{ php_disable_functions
@@ -311,9 +309,7 @@ PHP_INI_BEGIN()
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 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
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();
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c
index 101c449..5fba6f0 100644
--- a/sapi/apache/mod_php5.c
+++ b/sapi/apache/mod_php5.c
@@ -676,16 +676,10 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
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;
}
diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c
index 0ba545f..cc5091e 100644
--- a/sapi/apache2filter/sapi_apache2.c
+++ b/sapi/apache2filter/sapi_apache2.c
@@ -442,10 +442,10 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
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 @@ static int php_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
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);
diff --git a/sapi/apache2handler/sapi_apache2.c b/sapi/apache2handler/sapi_apache2.c
index a9deab7..79b31c9 100644
--- a/sapi/apache2handler/sapi_apache2.c
+++ b/sapi/apache2handler/sapi_apache2.c
@@ -624,14 +624,9 @@ zend_first_try {
} 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();
diff --git a/sapi/apache_hooks/mod_php5.c b/sapi/apache_hooks/mod_php5.c
index 7d46ce6..33b43e7 100644
--- a/sapi/apache_hooks/mod_php5.c
+++ b/sapi/apache_hooks/mod_php5.c
@@ -736,16 +736,10 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
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;
}
diff --git a/win32/build/config.w32 b/win32/build/config.w32
index ffd1085..f75e2c1 100644
--- a/win32/build/config.w32
+++ b/win32/build/config.w32
@@ -297,14 +297,6 @@ AC_DEFINE('HAVE_IPV6', main_network_has_ipv6);
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");