Ignore:
Timestamp:
Jun 18, 2009, 11:53:26 AM (16 years ago)
Author:
ydario
Message:

Kernel32 updates.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kernel32/os2heap.cpp

    r8877 r21302  
    4141#include "dbglocal.h"
    4242
     43#include <_ras.h>
     44
     45#ifdef RAS
     46RAS_TRACK_HANDLE rthHeap = 0;
     47#endif
     48
    4349#ifndef HEAP_NO_SERIALIZE
    4450  #define HEAP_NO_SERIALIZE 1
     
    94100    else  heap = this;
    95101    next = NULL;
     102
     103#ifdef RAS
     104    if (!rthHeap)
     105    {
     106        RasRegisterObjectTracking (&rthHeap, "Heap*, Global* and Local* memory",
     107                                   0, RAS_TRACK_FLAG_MEMORY | RAS_TRACK_FLAG_LOG_AT_EXIT,
     108                                   NULL, NULL);
     109    }
     110#endif
    96111
    97112    heaplistmutex.leave();
     
    173188        return(NULL);
    174189    }
     190   
     191    RasTrackMemAlloc (rthHeap, dwAllocBytes);
     192   
    175193    if(dwFlags & HEAP_ZERO_MEMORY) {
    176194        memset(lpMem, 0, dwAllocBytes+HEAP_OVERHEAD);
     
    238256    if (dwBytes <= maxSize) {
    239257        dprintf(("ReAlloc with smaller size than original (%d); return old pointer", maxSize));
     258       
     259        RasTrackMemRealloc (rthHeap, helem->cursize, dwBytes);
     260       
    240261        //update current size so HeapSize will return the right value
    241262        helem->cursize = dwBytes; 
     
    280301#endif
    281302
     303    RasTrackMemFree (rthHeap, helem->cursize);
     304
    282305    free(helem->lpMem);
     306   
    283307    return(TRUE);
    284308}
Note: See TracChangeset for help on using the changeset viewer.