Last Comment Bug 667474 - Do a basic computation of windows' size in the DOM Memory Reporter
: Do a basic computation of windows' size in the DOM Memory Reporter
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla7
Assigned To: Mounir Lamouri (:mounir)
:
:
Mentors:
Depends on: 667468 667470
Blocks: 663271 667485
  Show dependency treegraph
 
Reported: 2011-06-27 09:02 PDT by Mounir Lamouri (:mounir)
Modified: 2011-07-07 14:11 PDT (History)
2 users (show)
mounir: in‑testsuite-
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch v1 (3.22 KB, patch)
2011-06-27 09:04 PDT, Mounir Lamouri (:mounir)
jst: review+
Details | Diff | Splinter Review

Description Mounir Lamouri (:mounir) 2011-06-27 09:02:45 PDT
Basically, the idea of this patch is to add the code that goes trough all windows (even leaked ones) and add sizeof(*this) to the dom memory reporter section.
Documents/elements will be added in another bug same as improving window's memory usage computation.
Comment 1 Mounir Lamouri (:mounir) 2011-06-27 09:04:36 PDT
Created attachment 542173 [details] [diff] [review]
Patch v1
Comment 2 Johnny Stenback (:jst, jst@mozilla.com) 2011-06-27 17:13:35 PDT
Comment on attachment 542173 [details] [diff] [review]
Patch v1

+  PRInt64 SizeOf() const {
+    return sizeof(*this);

Is there precedence in other similar code to use PRInt64 for the return type of SizeOf()? If not, I think we should use size_t here, or PRUint64 if size_t is no good.

r=jst with that.
Comment 3 Nicholas Nethercote [:njn] 2011-06-27 18:27:45 PDT
PRInt64 is the return type for GetMemoryUsed() in nsIMemoryReporter classes, which is probably why Mounir is using it.
Comment 4 Mounir Lamouri (:mounir) 2011-06-28 01:16:31 PDT
Exactly. I believe I should keep PRInt64 given that the only caller needs PRInt64 and not size_t. Though, Nicholas, why nsIMemoryReporter uses PRInt64 instead of size_t?
Comment 5 Nicholas Nethercote [:njn] 2011-06-28 02:07:09 PDT
(In reply to comment #4)
> Though, Nicholas, why nsIMemoryReporter uses PRInt64 instead of size_t?

I don't know, it was like that when I inherited the code.
Comment 6 Mounir Lamouri (:mounir) 2011-06-29 08:43:35 PDT
http://hg.mozilla.org/mozilla-central/rev/6539e8965444
Comment 7 Mike Shaver (:shaver -- probably not reading bugmail closely) 2011-07-07 14:11:54 PDT
(In reply to comment #5)
> (In reply to comment #4)
> > Though, Nicholas, why nsIMemoryReporter uses PRInt64 instead of size_t?
> 
> I don't know, it was like that when I inherited the code.

It was like that because it was designed to be called from script in the first about:memory impl vlad did.

Note You need to log in before you can comment on or make changes to this bug.