cvs: ZendEngine2(PHP_5_2) / zend_alloc.c

[email protected] ("Arnaud Le Blanc") Sat, 30 May 2009 16:42:25 -0000
Newsgroups php.zend-engine.cvs
Message-ID <cvslbarnaud1243701745@cvsserver>
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;
 	}
 }