]> granicus.if.org Git - php/commitdiff
@- Added --enable-memory-usage-info. This creates a new Apache 1.x logging
authorThies C. Arntzen <thies@php.net>
Fri, 11 May 2001 18:17:08 +0000 (18:17 +0000)
committerThies C. Arntzen <thies@php.net>
Fri, 11 May 2001 18:17:08 +0000 (18:17 +0000)
@  directive "{mod_php_memory_usage}n" which will log the peak amount of
@  memory used by the script. (Thies)

sapi/apache/mod_php4.c

index 13af96edeec5289eb769475a51c64ca8eef82f79..54aea59e6e75232acbb78286f088f1da5b70e0d5 100644 (file)
@@ -540,7 +540,19 @@ static int send_php(request_rec *r, int display_source_mode, char *filename)
 
 static int send_parsed_php(request_rec * r)
 {
-       return send_php(r, 0, NULL);
+       int result =  send_php(r, 0, NULL);
+
+#if MEMORY_USAGE_INFO
+    {
+        char mem_usage[ 32 ];
+        ALS_FETCH()
+        sprintf(mem_usage,"%u", (int) AG(max_allocated_memory));
+        ap_table_setn(r->notes, "mod_php_memory_usage", ap_pstrdup(r->pool,mem_usage));
+    }
+#endif
+
+       return result;
 }