** Heap Operation Seconds. */ PR_fprintf(globals.mRequest.mFD, "<td align=right>" ST_MICROVAL_FORMAT "</td>\n", ST_MICROVAL_PRINTABLE(heapCost));
int displayMemoryLeaks(STRun* aRun){    int retval = 0;    if(NULL != aRun)    {        PRUint32 loop = 0;        PRUint32 displayed = 0;        STAllocation* current = NULL;        PR_fprintf(globals.mRequest.mFD, "<table border=1>\n");        PR_fprintf(globals.mRequest.mFD, "<tr>\n");        PR_fprintf(globals.mRequest.mFD, "<td><b>Rank</b></td>\n");        PR_fprintf(globals.mRequest.mFD, "<td><b>Index</b></td>\n");        PR_fprintf(globals.mRequest.mFD, "<td><b>Byte Size</b></td>\n");        PR_fprintf(globals.mRequest.mFD, "<td><b>Lifespan Seconds</b></td>\n");        PR_fprintf(globals.mRequest.mFD, "<td><b>Weight</b></td>\n");        PR_fprintf(globals.mRequest.mFD, "<td><b>Origin Callsite</b></td>\n");        PR_fprintf(globals.mRequest.mFD, "</tr>\n");        /*        ** Loop over all of the items, or until we've displayed enough.        */        for(loop = 0; displayed < globals.mOptions.mListItemMax && loop < aRun->mAllocationCount; loop++)        {            current = aRun->mAllocations[loop];            if(NULL != current && 0 != current->mEventCount)            {                /*                ** In order to be a leak, the last event of it's life must                **  NOT be a free operation.                **                ** A free operation is just that, a free.                */                if(TM_EVENT_FREE != current->mEvents[current->mEventCount - 1].mEventType)                {                    PRUint32 lifespan = current->mMaxTimeval - current->mMinTimeval;                    PRUint32 size = byteSize(current);                    PRUint64 weight64 = LL_INIT(0, 0);                    char buffer[32];                                        LL_MUL(weight64, (PRUint64)size, (PRUint64)lifespan);                    /*                    ** One more shown.                    */                    displayed++;                                        PR_fprintf(globals.mRequest.mFD, "<tr>\n");                                        /*                    ** Rank.                    */                    PR_fprintf(globals.mRequest.mFD, "<td align=right>%u</td>\n", displayed);                    /*                    ** Index.                    */                    PR_snprintf(buffer, sizeof(buffer), "%u", current->mRunIndex);                    PR_fprintf(globals.mRequest.mFD, "<td align=right>\n");                    htmlAllocationAnchor(current, buffer);                    PR_fprintf(globals.mRequest.mFD, "</td>\n");                                        /*                    ** Byte Size.                    */                    PR_fprintf(globals.mRequest.mFD, "<td align=right>%u</td>\n", size);                                        /*                    ** Lifespan.                    */                    PR_fprintf(globals.mRequest.mFD, "<td align=right>" ST_TIMEVAL_FORMAT "</td>\n", ST_TIMEVAL_PRINTABLE(lifespan));                                        /*                    ** Weight.                    */                    PR_fprintf(globals.mRequest.mFD, "<td align=right>%llu</td>\n", weight64);                                        /*                    ** Callsite.                    */                    PR_fprintf(globals.mRequest.mFD, "<td>");                    htmlCallsiteAnchor(current->mEvents[0].mCallsite, NULL, 0);                    PR_fprintf(globals.mRequest.mFD, "</td>\n");                                        PR_fprintf(globals.mRequest.mFD, "</tr>\n");                }            }        }        PR_fprintf(globals.mRequest.mFD, "</table>\n");    }    else    {        retval = __LINE__;        REPORT_ERROR(__LINE__, displayMemoryLeaks);    }    return retval;}