mirror of
https://github.com/php/php-src.git
synced 2024-09-22 18:37:25 +00:00
Make zend_memory_peak_usage() to be avalable even without --enable-memory-limit
This commit is contained in:
parent
3df7420fed
commit
b907cd59d5
@ -1850,16 +1850,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)
|
||||
|
@ -119,10 +119,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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user