mirror of
https://github.com/php/php-src.git
synced 2025-01-27 06:03:45 +08:00
added function get_memory_usage(). available only when PHP is compiled
with --enable-memory-limit
This commit is contained in:
parent
62f7e27141
commit
7866f02260
@ -544,6 +544,9 @@ function_entry basic_functions[] = {
|
||||
PHP_FE(var_export, NULL)
|
||||
PHP_FE(debug_zval_dump, NULL)
|
||||
PHP_FE(print_r, NULL)
|
||||
#if MEMORY_LIMIT
|
||||
PHP_FE(get_memory_usage, NULL)
|
||||
#endif
|
||||
|
||||
PHP_FE(register_shutdown_function, NULL)
|
||||
PHP_FE(register_tick_function, NULL)
|
||||
|
@ -28,6 +28,9 @@ PHP_FUNCTION(var_export);
|
||||
PHP_FUNCTION(debug_zval_dump);
|
||||
PHP_FUNCTION(serialize);
|
||||
PHP_FUNCTION(unserialize);
|
||||
#if MEMORY_LIMIT
|
||||
PHP_FUNCTION(get_memory_usage);
|
||||
#endif
|
||||
|
||||
void php_var_dump(zval **struc, int level TSRMLS_DC);
|
||||
void php_var_export(zval **struc, int level TSRMLS_DC);
|
||||
|
@ -677,6 +677,15 @@ PHP_FUNCTION(unserialize)
|
||||
|
||||
/* }}} */
|
||||
|
||||
#if MEMORY_LIMIT
|
||||
/* {{{ proto int get_memory_usage()
|
||||
Returns the allocated by PHP memory */
|
||||
PHP_FUNCTION(get_memory_usage) {
|
||||
RETURN_LONG(AG(allocated_memory));
|
||||
}
|
||||
/* }}} */
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Local variables:
|
||||
* tab-width: 4
|
||||
|
Loading…
Reference in New Issue
Block a user