summaryrefslogtreecommitdiff
path: root/sapi
diff options
context:
space:
mode:
Diffstat (limited to 'sapi')
-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
4 files changed, 11 insertions, 34 deletions
diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c
index 101c449240..5fba6f078c 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 0ba545f6ef..cc5091e8d9 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 a9deab7854..79b31c9be5 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 7d46ce62d9..33b43e77f0 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;
}