Make zend_memory_peak_usage() to be avalable even without --enable-memory-limit

This commit is contained in:
Dmitry Stogov 2006-10-12 06:46:51 +00:00
parent 8b8eb2cf88
commit e6fd66facb
2 changed files with 4 additions and 4 deletions

View file

@ -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)
{

View file

@ -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()