Ignore:
Timestamp:
07/10/17 18:17:04 (7 years ago)
Author:
yushan
Message:

branch merged with trunk @1200

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan_merged/src/memtrack.cpp

    r1160 r1205  
    5252{ 
    5353  void addr2line(const char *file_name, char** addr, int naddr) ; 
     54#ifdef XIOS_MEMTRACK_LIGHT 
     55  void addr2line(const char *file_name, char** addr, int naddr) {}  
     56#endif 
    5457} 
    5558/* ------------------------------------------------------------ */ 
     
    5962namespace MemTrack 
    6063{ 
     64    size_t currentMemorySize=0 ; 
     65    size_t maxMemorySize=0 ;  
     66 
     67    size_t getCurrentMemorySize(void) {return currentMemorySize; } 
     68    size_t getMaxMemorySize(void) {return maxMemorySize ; } 
    6169 
    6270    /* ------------------------------------------------------------ */ 
     
    376384        // Get the offset to the user chunk and return it. 
    377385        UserChunk *pUser = GetUserAddress(pProlog); 
     386 
     387        currentMemorySize += size ; 
     388        if (currentMemorySize>maxMemorySize) maxMemorySize=currentMemorySize ; 
    378389         
    379390        return pUser; 
     
    401412        // Unlink the block header from the list and destroy it. 
    402413        BlockHeader *pBlockHeader = GetHeaderAddress(pProlog); 
     414        currentMemorySize-=pBlockHeader->GetRequestedSize(); 
    403415        BlockHeader::RemoveNode(pBlockHeader); 
    404416        pBlockHeader->~BlockHeader(); 
Note: See TracChangeset for help on using the changeset viewer.