Confirmed users
1,345
edits
Nnethercote (talk | contribs) |
Nnethercote (talk | contribs) |
||
| Line 211: | Line 211: | ||
foo->SizeOfExcludingThis() // no | foo->SizeOfExcludingThis() // no | ||
Sometimes the memory reporter is a stand-alone class, like the | Sometimes the memory reporter is a stand-alone class, like the <tt>MyStringReporter</tt> example above. But often you'll have a singleton class that needs measuring, in which case it is usually better not to have a separate reporter object, but instead for the singleton class to implement <tt>nsIMemoryReporter</tt> and report its own memory consumption. There are many examples of this in the code, such as <tt>nsCategoryManager</tt>. | ||
If you write a memory reporter, please get two people to review it: (a) someone who knows the data structures being measured, and (b) nnethercote, who can check for all the things covered by this document. Thanks! | If you write a memory reporter, please get two people to review it: (a) someone who knows the data structures being measured, and (b) nnethercote, who can check for all the things covered by this document. Thanks! | ||