summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2006-10-12 06:46:51 +0000
committerDmitry Stogov <dmitry@php.net>2006-10-12 06:46:51 +0000
commite6fd66facbe1766e8ad53e7826471796ea7eb6dd (patch)
treedde6b3f361f20f9490404bafa8bd1c2876992677
parent8b8eb2cf88a2ce9bb27f589b290175201b30546d (diff)
downloadphp-git-e6fd66facbe1766e8ad53e7826471796ea7eb6dd.tar.gz
Make zend_memory_peak_usage() to be avalable even without --enable-memory-limit
-rw-r--r--Zend/zend_alloc.c6
-rw-r--r--Zend/zend_alloc.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index a51e963b4a..5303c9b1fb 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -1808,16 +1808,18 @@ ZEND_API size_t zend_memory_usage(int real_usage TSRMLS_DC)
}
}
-#if MEMORY_LIMIT
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)
{
diff --git a/Zend/zend_alloc.h b/Zend/zend_alloc.h
index 9be4342348..48f941ba7d 100644
--- a/Zend/zend_alloc.h
+++ b/Zend/zend_alloc.h
@@ -108,10 +108,8 @@ void zend_debug_alloc_output(char *format, ...);
#define full_mem_check(silent)
#endif
-#if MEMORY_LIMIT
ZEND_API size_t zend_memory_usage(int real_usage TSRMLS_DC);
ZEND_API size_t zend_memory_peak_usage(int real_usage TSRMLS_DC);
-#endif
END_EXTERN_C()