fix the MallocTools anchor reference - docs only

This commit is contained in:
alecf%netscape.com 2001-11-18 18:33:06 +00:00
Родитель 2e3dd4db41
Коммит 9b15419c4a
2 изменённых файлов: 2 добавлений и 163 удалений

Просмотреть файл

@ -49,7 +49,7 @@ to leaves form stack traces that call malloc, calloc, realloc, and free,
can by built in-process by building with --enable-trace-malloc and running can by built in-process by building with --enable-trace-malloc and running
with --trace-malloc <i>filename</i>.&nbsp; As malloc, free, etc. are called, with --trace-malloc <i>filename</i>.&nbsp; As malloc, free, etc. are called,
log events identifying the function call and its callsite are emitted to log events identifying the function call and its callsite are emitted to
<i>filename</i>. (more <a href="TraceMalloc">below</a>).<br> <i>filename</i>. (more <a href="#TraceMalloc">below</a>).<br>
</li> </li>
<li> <b>Leaky</b> - This tool also dumps out stack traces (in a slightly <li> <b>Leaky</b> - This tool also dumps out stack traces (in a slightly
@ -911,7 +911,7 @@ and a binary log of events and callsite relations will be written to <i>filename
machinery keeps track of all live allocations, and builds its tree of callsites machinery keeps track of all live allocations, and builds its tree of callsites
to keep book on stack backtraces.<br> to keep book on stack backtraces.<br>
<br> <br>
Tools such as bloatblame (xpcom/base/bloatblame.c) can be used to process Tools such as bloatblame (tools/trace-malloc/bloatblame.c) can be used to process
<i>filename</i>.&nbsp; Try running <i>filename</i>.&nbsp; Try running
with the unified output format option, -u.&nbsp; The output is a large HTML with the unified output format option, -u.&nbsp; The output is a large HTML
file that hyperlinks ancestor and descendent libraries, classes, and functions file that hyperlinks ancestor and descendent libraries, classes, and functions

Просмотреть файл

@ -1,161 +0,0 @@
<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Author" content="pnunn">
<meta name="GENERATOR" content="Mozilla/4.5 [en]C-NSCP (WinNT; U) [Netscape]">
<title>xpCom FAQ</title>
</head>
<body>
<b><font size=+3>XPCOM FAQ</font></b>
<p>Get out your decoder rings kids!
<p>Having a basic understanding of COM is only the first
<br>step. To get CMonkey code to build and run,
<br>you&nbsp; need to translate your COM ideas into Netscape
<br>speak.
<p>Feel free to add to this document or change incorrect info.
<br>Hopefully more info and more examples will help new
<br>people reach XPCOM nirvana more quickly.
<p><b>To mentally translate XPCOM to COM.</b>
<br>&nbsp;
<table BORDER COLS=2 WIDTH="100%" >
<tr>
<td BGCOLOR="#CCCCCC"><b>vanilla COM</b></td>
<td BGCOLOR="#FFCCCC"><b>XPCOM</b></td>
</tr>
<tr>
<td BGCOLOR="#CCCCCC">&nbsp;IUnknown</td>
<td BGCOLOR="#FFCCCC">nsISupports</td>
</tr>
<tr>
<td BGCOLOR="#CCCCCC">IClassFactory</td>
<td BGCOLOR="#FFCCCC">nsIFactory</td>
</tr>
<tr>
<td BGCOLOR="#CCCCCC">virtual void _stdcall</td>
<td BGCOLOR="#FFCCCC">NS_IMETHOD</td>
</tr>
<tr>
<td BGCOLOR="#CCCCCC">interface ID = IID</td>
<td BGCOLOR="#FFCCCC">nsID = nsIID = IID</td>
</tr>
<tr>
<td BGCOLOR="#CCCCCC">class ID = CLSID&nbsp;</td>
<td BGCOLOR="#FFCCCC">nsCID = CID</td>
</tr>
</table>
<p>Not too difficult.
<br>But wait. There's more.
<br><b>-------------------------------------------</b>
<p><b><font size=+1>Why don't those classes have AddRef?</font></b>
<p>Actually, those classes do have AddRef. It is hidden
<br>in a macro. There are alot of&nbsp; macros that are alot of&nbsp; help
<br>once you know :
<br>&nbsp;&nbsp;&nbsp; 1) They exist.
<p>&nbsp;&nbsp;&nbsp; 2) Where they are defined. (They aren't always mnemonic
or onomatipeic.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
You might want to print them out.)
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mozilla/xpcom/public/nsCom.h
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mozilla/xpcom/public/nsISupports.h
<p>&nbsp;&nbsp;&nbsp; 3)What they are
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Here's a short list to give you an idea of what you've been missing.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
The include files listed above are the real reference.
<p>&nbsp;&nbsp;&nbsp; 4) A quick way to expand pesky macros:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
For macros in&nbsp; foo.cpp,&nbsp; 'make foo.i'
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This
will pump the foo.cpp file through C preprocessing
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
and expand all the macros for you.&nbsp; The output can be
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
hard to read, but if you search for&nbsp; unique strings
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
in the area you aredebugging, you can navigate
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
the file pretty easily.
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(thanks to hshaw@netscape.com)
<br>&nbsp;
<br>&nbsp;
<br>&nbsp;
<table BORDER COLS=2 WIDTH="100%" BGCOLOR="#CCCCCC" >
<tr>
<td BGCOLOR="#FFCCCC"><b><font size=+1>Netscape MACRO</font></b></td>
<td><b><font size=+1>Expansion of macro</font></b></td>
</tr>
<tr>
<td BGCOLOR="#FFCCCC">NSADDREF(factoryinstname)</td>
<td>Factory->AddRef();</td>
</tr>
<tr>
<td BGCOLOR="#FFCCCC">NS_IMETHOD</td>
<td>virtual nsresult __stdcall</td>
</tr>
<tr>
<td BGCOLOR="#FFCCCC">NS_INIT_REFCNT()</td>
<td>mRefCnt = 0</td>
</tr>
<tr>
<td BGCOLOR="#FFCCCC">NS_INIT_ISUPPORTS()</td>
<td>NS_INIT_REFCNT()</td>
</tr>
<tr>
<td BGCOLOR="#FFCCCC">NS_DECL_ISUPPORTS</td>
<td>public:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NS_IMETHOD QueryInterface(REFNSIID
aIID,
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
void** aInstancePtr);
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NS_IMETHOD_(nsrefcnt)
AddRef(void);
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NS_IMETHOD_(nsrefcnt)
Release(void);
<br>&nbsp;&nbsp;&nbsp; protected:
<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; nsrefcnt mRefCnt;</td>
</tr>
</table>
<p>&nbsp;<font size=+1>Useful Links to COM Documents:</font>
<p><a href="http://www.mozilla.org/projects/xpcom/">XPCOM&nbsp; Page</a>
<br><a href="http://www.mozilla.org/projects/xpcom/nsCOMPtr.html">nsCOMPtr</a>
<br><a href="http://warp.netscape.com/client/raptor/codingconventions.html">Coding
Conventions</a>
<br><a href="http://warp/client/bam/eng/howto.html">Getting BAMmed</a>
<br><a href="http://warp/client/bam/eng/comdoc.html">How to COM</a>
<br><a href="http://www.mozilla.org/docs/tplist/catFlow/modunote.htm">Modularization
Techniques</a>
<br><a href="http://www.mozilla.org/docs/tplist/catBuild/portable-cpp.html">C++
Portability Guide</a>
<br><a href="http://www.mozilla.org/newlayout/">NGLayout</a>
<br>&nbsp;
<br>&nbsp;
<br>&nbsp;
</body>
</html>