initHeapObject(&inObject);
initHeapObject(&newObject);
int simpleHeapEvent(TMState* inStats, HeapEventType inType, unsigned mTimestamp, unsigned inSerial, unsigned inHeapID, unsigned inSize)/***  A new heap event will cause the creation of a new heap object.**  The new heap object will displace, or replace, a heap object of a different type.*/{    int retval = 0;    HeapObject newObject;    /*    **  Set the most basic object details.    */    initHeapObject(&inObject);    newObject.mHeapOffset = inHeapID;    newObject.mSize = inSize;    if(FREE == inType)    {        newObject.mType = FRAGMENT;    }    else if(ALLOC == inType)    {        newObject.mType = ALLOCATION;    }    /*    **  Add it to the heap object array.    */    /*    **  TODO GAB    **    **  First thing to do is to add the new object to the heap in order to    **      obtain a valid index.    **    **  Next, find all matches to this range of heap memory that this event    **      refers to, that are alive during this timestamp (no death yet).    **  Fill in the death event of those objects.    **  If the objects contain some portions outside of the range, then    **      new objects for those ranges need to be created that carry on    **      the same object type, have the index of the old object for birth,    **      and the serial of the old object, new timestamp of course.    **  The old object's death points to the new object, which tells why the    **      fragmentation took place.    **  The new object birth points to the old object only if a fragment.    **  An allocation only has a birth object when it is a realloc (complex)    **      heap event.    **    **  I believe this give us enough information to look up particular    **      details of the heap at any given time.    */    return retval;}