Skip to content

Commit e6fd66f

Browse files
committed
Make zend_memory_peak_usage() to be avalable even without --enable-memory-limit
1 parent 8b8eb2c commit e6fd66f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Zend/zend_alloc.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1808,16 +1808,18 @@ ZEND_API size_t zend_memory_usage(int real_usage TSRMLS_DC)
18081808
}
18091809
}
18101810

1811-
#if MEMORY_LIMIT
18121811
ZEND_API size_t zend_memory_peak_usage(int real_usage TSRMLS_DC)
18131812
{
1813+
#if MEMORY_LIMIT
18141814
if (real_usage) {
18151815
return AG(mm_heap)->real_peak;
18161816
} else {
18171817
return AG(mm_heap)->peak;
18181818
}
1819-
}
1819+
#else
1820+
return 0;
18201821
#endif
1822+
}
18211823

18221824
ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC)
18231825
{

Zend/zend_alloc.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,8 @@ void zend_debug_alloc_output(char *format, ...);
108108
#define full_mem_check(silent)
109109
#endif
110110

111-
#if MEMORY_LIMIT
112111
ZEND_API size_t zend_memory_usage(int real_usage TSRMLS_DC);
113112
ZEND_API size_t zend_memory_peak_usage(int real_usage TSRMLS_DC);
114-
#endif
115113

116114
END_EXTERN_C()
117115

0 commit comments

Comments
 (0)