cvs: ZendEngine2(PHP_5_2) / zend_alloc.c
| From: | Arnaud Le Blanc | Date: | Sat, 30 May 2009 16:42:25 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_2) / zend_alloc.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-7631@lists.php.net to get a copy of this message | ||
lbarnaud Sat May 30 16:42:25 2009 UTC
Modified files: (Branch: PHP_5_2)
/ZendEngine2 zend_alloc.c
Log:
MFH: Take small blocks cache into account in memory_get_usage()
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_alloc.c?r1=1.144.2.3.2.55&r2=1.144.2.3.2.56&diff_format=u
Index: ZendEngine2/zend_alloc.c
diff -u ZendEngine2/zend_alloc.c:1.144.2.3.2.55 ZendEngine2/zend_alloc.c:1.144.2.3.2.56
--- ZendEngine2/zend_alloc.c:1.144.2.3.2.55 Wed Apr 1 16:56:08 2009
+++ ZendEngine2/zend_alloc.c Sat May 30 16:42:24 2009
@@ -18,7 +18,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: zend_alloc.c,v 1.144.2.3.2.55 2009/04/01 16:56:08 felipe Exp $ */
+/* $Id: zend_alloc.c,v 1.144.2.3.2.56 2009/05/30 16:42:24 lbarnaud Exp $ */
#include "zend.h"
#include "zend_alloc.h"
@@ -2477,7 +2477,11 @@
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;
}
}