summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Le Blanc <lbarnaud@php.net>2009-05-30 16:42:13 +0000
committerArnaud Le Blanc <lbarnaud@php.net>2009-05-30 16:42:13 +0000
commitb4d9c79162a59b12a3674695d5d5e3b2d8d70acc (patch)
tree5b405d8faac3d734bf3d0cb2400312de31809ee5
parentbed00e15d136a94f04f99edda67703cd667f7d6f (diff)
downloadphp-git-b4d9c79162a59b12a3674695d5d5e3b2d8d70acc.tar.gz
MFH: Take small blocks cache into account in memory_get_usage()
-rw-r--r--Zend/zend_alloc.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Zend/zend_alloc.c b/Zend/zend_alloc.c
index da64081c3a..22963d87b3 100644
--- a/Zend/zend_alloc.c
+++ b/Zend/zend_alloc.c
@@ -2496,7 +2496,11 @@ ZEND_API size_t zend_memory_usage(int real_usage TSRMLS_DC)
if (real_usage) {
return AG(mm_heap)->real_size;
} else {
- return AG(mm_heap)->size;
+ size_t usage = AG(mm_heap)->size;
+#if ZEND_MM_CACHE
+ usage -= AG(mm_heap)->cached;
+#endif
+ return usage;
}
}