Confirmed users
1,345
edits
Nnethercote (talk | contribs) |
Nnethercote (talk | contribs) |
||
Line 138: | Line 138: | ||
return n; | return n; | ||
} | } | ||
}; | }; | ||
Line 148: | Line 146: | ||
* <tt>D::SizeOfExcludingThis</tt> must also call <tt>B::SizeOfExcludingThis</tt>, to ensure that any objects pointed to by fields inherited from <tt>B</tt> are measured. | * <tt>D::SizeOfExcludingThis</tt> must also call <tt>B::SizeOfExcludingThis</tt>, to ensure that any objects pointed to by fields inherited from <tt>B</tt> are measured. | ||
* | * <tt>D::SizeOfIncludingThis</tt> is inherited from <tt>B</tt>. The <tt>SizeOfExcludingThis()</tt> call within will be dispatched to <tt>D::SizeOfExcludingThis</tt> when appropriate (because <tt>B::SizeOfIncludingThis</tt> is <tt>virtual</tt>) which is what we want. | ||
* The <tt>NS_MUST_OVERRIDE</tt> is an annotation that indicates that this function must be overridden by any sub-classes. It's used by some static analysis tools. Currently these tools aren't running, but they might in the future, and it's a useful piece of documentation. | * The <tt>NS_MUST_OVERRIDE</tt> is an annotation that indicates that this function must be overridden by any sub-classes. It's used by some static analysis tools. Currently these tools aren't running, but they might in the future, and it's a useful piece of documentation. |