Confirmed users
1,345
edits
Nnethercote (talk | contribs) |
Nnethercote (talk | contribs) |
||
Line 211: | Line 211: | ||
foo->SizeOfExcludingThis() // no | foo->SizeOfExcludingThis() // no | ||
Sometimes | Sometimes memory reporters are stand-alone objects, like the <tt>MyStringReporter</tt> example above. But often you'll have a singleton object that needs measuring, in which case it is usually better not to have a separate reporter object, but instead for the singleton object to implement <tt>nsIMemoryReporter</tt>, and thus measure and report its own memory consumption. There are many such examples 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! |