IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jun 23, 2004, 1:00:17 PM (22 years ago)
Author:
desonia
Message:

Changed the means of deallocation of memory. ps_Alloc now registers an optional free function to handle any additional processing of a memory object.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/test/collections/tst_psList.c

    r1033 r1073  
    66 *  @author Robert DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-06-14 23:03:43 $
     8 *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
     9 *  @date $Date: 2004-06-23 23:00:15 $
    1010 *
    1111 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    7878    }
    7979
    80     psListFree(list,NULL);
     80    psFree(list);
    8181
    8282    list = psListAlloc(data);
     
    108108
    109109
    110     psListFree(list,PS_FREE);
     110    psFree(list);
     111
     112    psFree(data);
    111113
    112114    return 0;
     
    283285    }
    284286
    285     psListFree(list, PS_FREE);
     287    psFree(list);
    286288
    287289    return 0;
     
    339341    *data = 0;
    340342    list = psListAlloc(data);
     343    psFree(data);
    341344
    342345    data = psAlloc(sizeof(int));
    343346    *data = 1;
    344347    list = psListAdd(list,data,PS_LIST_TAIL);
     348    psFree(data);
    345349
    346350    data = psAlloc(sizeof(int));
    347351    *data = 2;
    348352    list = psListAdd(list,data,PS_LIST_TAIL);
     353    psFree(data);
    349354
    350355    data = psAlloc(sizeof(int));
    351356    *data = 3;
    352357    list = psListAdd(list,data,PS_LIST_TAIL);
     358    psFree(data);
    353359
    354360    //  2. which>0 and which<list.n.
     
    404410    }
    405411
    406     psListFree(list,PS_FREE);
     412    psFree(list);
    407413
    408414    return 0;
     
    637643    }
    638644
    639     psListFree(list,PS_FREE);
     645    psFree(list);
    640646
    641647    return 0;
     
    691697    }
    692698
    693     psVectorFree(vec);
    694     psListFree(list,PS_FREE);
     699    psFree(vec);
     700    psFree(list);
    695701
    696702    // test vector -> dlist
     
    729735    }
    730736
    731     psVectorFree(vec);
    732     psListFree(list,PS_FREE);
     737    psFree(vec);
     738    psFree(list);
    733739
    734740    // now, make sure if input vector/list is NULL, output is NULL
     
    755761        return 1;
    756762    }
    757     psVectorFree(vec);
    758     psListFree(list,PS_FREE);
     763    psFree(vec);
     764    psFree(list);
    759765
    760766    list = psListAlloc(NULL);
     
    765771        return 1;
    766772    }
    767     psVectorFree(vec);
    768     psListFree(list,PS_FREE);
     773    psFree(vec);
     774    psFree(list);
    769775
    770776    return 0;
     
    895901    }
    896902
    897     psListFree(list,PS_FREE);
     903    psFree(list);
    898904
    899905    return 0;
     
    938944    */
    939945
    940     psListFree(list,NULL);
     946    psFree(list);
    941947
    942948    /*
Note: See TracChangeset for help on using the changeset viewer.