if(TM_EVENT_FREE != aAllocation->mEvents[eventLoop].mEventType)
while(NULL != callsite && NULL != callsite->method)
int appendAllocation(STRun* aRun, STAllocation* aAllocation){    int retval = 0;    if(NULL != aRun && NULL != aAllocation)    {        STAllocation** expand = NULL;        /*        ** Expand the size of the array if needed.        */        expand = (STAllocation**)realloc(aRun->mAllocations, sizeof(STAllocation*) * (aRun->mAllocationCount + 1));        if(NULL != expand)        {            /*            ** Reassign in case of pointer move.            */            aRun->mAllocations = expand;            /*            ** Stick the allocation in.            */            aRun->mAllocations[aRun->mAllocationCount] = aAllocation;            /*            ** If this is the global run, we need to let the allocation            **  track the index back to us.            */            if(&globals.mRun == aRun)            {                aAllocation->mRunIndex = aRun->mAllocationCount;            }            /*            ** Increase the count.            */            aRun->mAllocationCount++;            /*            ** We're good.            */            retval = __LINE__;            /*            ** Now, see if they desire a callsite update.            ** As mentioned previously, we decide if the run desires us to            **  manipulate the callsite data only if it's stamp is set.            ** We change all callsites and parent callsites to have that            **  stamp as well, so as to mark them as being relevant to            **  the current run in question.            */            if(0 != aRun->mStats.mStamp)            {                PRUint32 timeval = aAllocation->mMaxTimeval - aAllocation->mMinTimeval;                PRUint32 size = byteSize(aAllocation);                PRUint64 weight64 = LL_INIT(0, 0);                PRUint32 eventLoop = 0;                LL_MUL(weight64, (PRUint64)timeval, (PRUint64)size);                /*                ** First, update this run.                */                aRun->mStats.mSize += size;                LL_ADD(aRun->mStats.mTimeval64, aRun->mStats.mTimeval64, (PRUint64)timeval);                LL_ADD(aRun->mStats.mWeight64, aRun->mStats.mWeight64, weight64);                /*                ** Next, go through the events of the allocation.                */                for(eventLoop = 0; eventLoop < aAllocation->mEventCount; eventLoop++)                {                    /*                    ** If not a free...                    */                    if(TM_EVENT_FREE != aAllocation->mEvents[eventLoop].mEventType)                    {                        tmcallsite* callsite = aAllocation->mEvents[eventLoop].mCallsite;                        STRun* callsiteRun = NULL;                        /*                        ** Go up parents till we drop.                        */                        while(NULL != callsite && NULL != callsite->method)                        {                            callsiteRun = CALLSITE_RUN(callsite);                            if(NULL != callsiteRun)                            {                                /*                                ** Do we init it?                                */                                if(callsiteRun->mStats.mStamp != aRun->mStats.mStamp)                                {                                    memset(&callsiteRun->mStats, 0, sizeof(STCallsiteStats));                                    callsiteRun->mStats.mStamp = aRun->mStats.mStamp;                                }                                /*                                ** Add the values.                                ** The realloc size and weights are a bit off,                                **  as they represent the final size....                                ** Hmm... This means that if the same site                                **  reallocs N times, we are N-1 times over.                                */                                callsiteRun->mStats.mSize += size;                                LL_ADD(callsiteRun->mStats.mTimeval64, callsiteRun->mStats.mTimeval64, (PRUint64)timeval);                                LL_ADD(callsiteRun->mStats.mWeight64, callsiteRun->mStats.mWeight64, weight64);                            }                            callsite = callsite->parent;                        }                    }                }            }        }        else        {            REPORT_ERROR(__LINE__, appendAllocation);        }    }    else    {        REPORT_ERROR(__LINE__, appendAllocation);    }    return retval;}