IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 14, 2004, 1:48:25 PM (22 years ago)
Author:
desonia
Message:

adjustments to coorespond to adding persistent flag to psMemBlock, i.e.,
exclusion of internal library blocks in memory leak checks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/sys/psMemory.c

    r1730 r1810  
    1 
    21/** @file  psMemory.c
    32*
     
    98*  @author Robert Lupton, Princeton University
    109*
    11 *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
    12 *  @date $Date: 2004-09-08 21:06:00 $
     10*  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
     11*  @date $Date: 2004-09-14 23:48:25 $
    1312*
    1413*  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    341340    ptr->file = file;
    342341    ptr->freeFcn = NULL;
     342    ptr->persistent = false;
    343343    *(unsigned int *)&ptr->lineno = lineno;
    344344    *(void **)((int8_t *) (ptr + 1) + size) = P_PS_MEMMAGIC;
     
    446446
    447447    for (psMemBlock* iter = topBlock; iter != NULL; iter = iter->nextBlock) {
    448         if ((psMemGetRefCounter(iter + 1) > 0) && (iter->id >= id0)) {
     448        if ( (iter->refCounter > 0) &&
     449                (! iter->persistent) &&
     450                (iter->id >= id0)) {
     451
    449452            nleak++;
    450453
     
    469472
    470473    for (psMemBlock* iter = topBlock; iter != NULL; iter = iter->nextBlock) {
    471         if ((psMemGetRefCounter(iter + 1) > 0) && (iter->id >= id0)) {
     474        if ( (iter->refCounter > 0) &&
     475                (! iter->persistent) &&
     476                (iter->id >= id0)) {
     477
    472478            (*arr)[j++] = iter;
    473479            if (j == nleak) {              // found them all
     
    651657    return ptr->freeFcn;
    652658}
     659
     660bool p_psMemGetPersistent(void *vptr)
     661{
     662    if (vptr == NULL) {
     663        return NULL;
     664    }
     665
     666    psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
     667
     668    if (checkMemBlock(ptr, __func__) != 0) {
     669        memProblemCallback(ptr, __func__, __LINE__);
     670    }
     671
     672    return ptr->persistent;
     673}
     674
     675void p_psMemSetPersistent(void *vptr,bool value)
     676{
     677    if (vptr == NULL) {
     678        return;
     679    }
     680
     681    psMemBlock* ptr = ((psMemBlock* ) vptr) - 1;
     682
     683    if (checkMemBlock(ptr, __func__) != 0) {
     684        memProblemCallback(ptr, __func__, __LINE__);
     685    }
     686
     687    ptr->persistent = value;
     688}
Note: See TracChangeset for help on using the changeset viewer.