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/src/collections/psList.c

    r1024 r1073  
    66 *  @author Robert Daniel DeSonia, MHPCC
    77 *
    8  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    9  *  @date $Date: 2004-06-14 19:45:46 $
     8 *  @version $Revision: 1.7 $ $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
     
    2828
    2929// private functions.
    30 psListElem* listGetIterator(psList* list);
    31 int listGetIteratorIndex(psList* list);
    32 void listSetIterator(psList *list, int where, bool lockList);
     30static psListElem* listGetIterator(psList* list);
     31static int listGetIteratorIndex(psList* list);
     32static void listSetIterator(psList *list, int where, bool lockList);
     33static void listFree(psList *list);
    3334
    3435
     
    3637{
    3738    psList *list = psAlloc(sizeof(psList));
     39    p_psMemSetDeallocator(list,(psFreeFcn)listFree);
    3840
    3941    list->size = 0;
     
    4143    list->iter = ITER_INIT_HEAD;
    4244    list->iterIndex = PS_LIST_HEAD;
     45
    4346    pthread_mutex_init(&(list->lock),NULL)
    4447    ;
     
    5154}
    5255
    53 void psListFree(psList *list, psFreeFcn elemFree)
     56static void listFree(psList *list)
    5457{
    5558    if (list == NULL) {
     
    6366        psListElem *next = ptr->next;
    6467
    65         p_psCustomFree(elemFree, psMemDecrRefCounter(ptr->data));
     68        psFree(ptr->data);
    6669        psFree(ptr);
    6770
     
    7578    ;
    7679
    77     psFree(list);
    7880}
    7981
Note: See TracChangeset for help on using the changeset viewer.