Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Issue 261037: Add an API to V8 to get simple heap statistics. (Closed)

Created:
11 years, 2 months ago by Mads Ager (chromium)
Modified:
9 years, 7 months ago
CC:
v8-dev
Visibility:
Public.

Description

Add an API to V8 to get simple heap statistics. Committed: http://code.google.com/p/v8/source/detail?r=3089

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 3

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+102 lines, -11 lines) Patch
M include/v8.h View 1 2 2 chunks +27 lines, -0 lines 0 comments Download
M src/api.cc View 1 2 1 chunk +9 lines, -0 lines 0 comments Download
M src/heap.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M src/heap.cc View 1 2 2 chunks +39 lines, -11 lines 0 comments Download
M src/spaces.h View 1 2 2 chunks +12 lines, -0 lines 0 comments Download
M test/cctest/test-api.cc View 1 2 1 chunk +12 lines, -0 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
Mads Ager (chromium)
11 years, 2 months ago (2009-10-09 13:05:42 UTC) #1
mnaganov (inactive)
http://codereview.chromium.org/261037/diff/3001/4005 File src/spaces.h (right): http://codereview.chromium.org/261037/diff/3001/4005#newcode1268 Line 1268: if (from_space_.is_committed()) return 2 * Capacity(); Ah, I ...
11 years, 2 months ago (2009-10-09 16:14:32 UTC) #2
Kevin Millikin (Chromium)
LGTM http://codereview.chromium.org/261037/diff/3001/4002 File include/v8.h (right): http://codereview.chromium.org/261037/diff/3001/4002#newcode2107 Line 2107: size_t total_heap_size() { return total_heap_size_; } There's ...
11 years, 2 months ago (2009-10-19 18:49:38 UTC) #3
iposva
11 years, 2 months ago (2009-10-19 20:33:42 UTC) #4
Strong opinion on accessors included.

-Ivan

http://codereview.chromium.org/261037/diff/3001/4002
File include/v8.h (right):

http://codereview.chromium.org/261037/diff/3001/4002#newcode2107
Line 2107: size_t total_heap_size() { return total_heap_size_; }
On 2009/10/19 18:49:39, Kevin Millikin wrote:
> There's not much gained by making the fields private and having accessors. 
> Consider just making them public.

I strongly disagree. If you make the fields public you have no control which
code touches the fields directly. By going through an accessor you can abstract
the implementation later without having to hunt down all the clients accessing
the data.

Also, I would suggest that you make the setter private and friend
ImplementationUtilities to allow setting only from within the V8 internal
implementation. This is external access to the field is what Kevin was really
complaining about (I think).

Powered by Google App Engine
This is Rietveld 408576698