From 2a4245e0c090b0bf85de56366933a32ef3fce327 Mon Sep 17 00:00:00 2001 From: "ricow@chromium.org" Date: Fri, 14 Oct 2011 09:25:10 +0000 Subject: [PATCH] Fix available new space memory statistics reporting. We currently report how much memory is available without changing page, i.e., the actual amount of available memory is not correctly stated for new space when doing --trace-gc. Review URL: http://codereview.chromium.org/8275026 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@9624 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/spaces.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/spaces.h b/src/spaces.h index c6bfd36a87..2fddba5776 100644 --- a/src/spaces.h +++ b/src/spaces.h @@ -2096,10 +2096,9 @@ class NewSpace : public Space { return Capacity(); } - // Return the available bytes without growing or switching page in the - // active semispace. + // Return the available bytes without growing. intptr_t Available() { - return allocation_info_.limit - allocation_info_.top; + return Capacity() - Size(); } // Return the maximum capacity of a semispace.