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/image/psImage.c

    r996 r1073  
    99 *  @author Ross Harman, MHPCC
    1010 *
    11  *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-06-11 02:02:53 $
     11 *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-06-23 23:00:15 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2828#include "psImage.h"
    2929
     30static void imageFree(psImage* image);
    3031
    3132/*****************************************************************************/
     
    4950
    5051    psImage *image = (psImage *)psAlloc(sizeof(psImage));
     52    p_psMemSetDeallocator(image,(psFreeFcn)imageFree);
    5153
    5254    image->data.V = psAlloc(sizeof(void*)*numRows);
     
    7173}
    7274
    73 void psImageFree(psImage *image)
     75static void imageFree(psImage* image)
    7476{
    7577    if (image == NULL) {
     
    9698    psFree(image->data.V);
    9799    image->data.V = NULL;
    98 
    99     psFree(image);
    100100}
    101101
     
    237237        if (children[i] != NULL) {
    238238            numFreed++;
    239             psImageFree(children[i]);
     239            psFree(children[i]);
    240240        }
    241241    }
     
    341341    case PS_TYPE_PTR: \
    342342        psError(__func__,"Can't copy image from a matrix of pointers."); \
    343         psImageFree(output); \
     343        psFree(output); \
    344344        return NULL; \
    345345    default: \
     
    391391    case PS_TYPE_PTR:
    392392        psError(__func__,"Can't copy image into a matrix of pointers.");
    393         psImageFree(output);
     393        psFree(output);
    394394        return NULL;
    395395    }
     
    534534        case PS_TYPE_PTR:
    535535            psError (__func__, "Can't copy image from a matrix of pointers.");
    536             psImageFree (output);
     536            psFree (output);
    537537            return ((void *) 0);
    538538        default:
     
    676676        case PS_TYPE_PTR:
    677677            psError (__func__, "Can't copy image from a matrix of pointers.");
    678             psImageFree (output);
     678            psFree (output);
    679679            return ((void *) 0);
    680680        default:
     
    818818        case PS_TYPE_PTR:
    819819            psError (__func__, "Can't copy image from a matrix of pointers.");
    820             psImageFree (output);
     820            psFree (output);
    821821            return ((void *) 0);
    822822        default:
     
    960960        case PS_TYPE_PTR:
    961961            psError (__func__, "Can't copy image from a matrix of pointers.");
    962             psImageFree (output);
     962            psFree (output);
    963963            return ((void *) 0);
    964964        default:
     
    11021102        case PS_TYPE_PTR:
    11031103            psError (__func__, "Can't copy image from a matrix of pointers.");
    1104             psImageFree (output);
     1104            psFree (output);
    11051105            return ((void *) 0);
    11061106        default:
     
    12441244        case PS_TYPE_PTR:
    12451245            psError (__func__, "Can't copy image from a matrix of pointers.");
    1246             psImageFree (output);
     1246            psFree (output);
    12471247            return ((void *) 0);
    12481248        default:
     
    13861386        case PS_TYPE_PTR:
    13871387            psError (__func__, "Can't copy image from a matrix of pointers.");
    1388             psImageFree (output);
     1388            psFree (output);
    13891389            return ((void *) 0);
    13901390        default:
     
    15281528        case PS_TYPE_PTR:
    15291529            psError (__func__, "Can't copy image from a matrix of pointers.");
    1530             psImageFree (output);
     1530            psFree (output);
    15311531            return ((void *) 0);
    15321532        default:
     
    16701670        case PS_TYPE_PTR:
    16711671            psError (__func__, "Can't copy image from a matrix of pointers.");
    1672             psImageFree (output);
     1672            psFree (output);
    16731673            return ((void *) 0);
    16741674        default:
     
    18121812        case PS_TYPE_PTR:
    18131813            psError (__func__, "Can't copy image from a matrix of pointers.");
    1814             psImageFree (output);
     1814            psFree (output);
    18151815            return ((void *) 0);
    18161816        default:
     
    19541954        case PS_TYPE_PTR:
    19551955            psError (__func__, "Can't copy image from a matrix of pointers.");
    1956             psImageFree (output);
     1956            psFree (output);
    19571957            return ((void *) 0);
    19581958        default:
     
    20962096        case PS_TYPE_PTR:
    20972097            psError (__func__, "Can't copy image from a matrix of pointers.");
    2098             psImageFree (output);
     2098            psFree (output);
    20992099            return ((void *) 0);
    21002100        default:
     
    21042104    case PS_TYPE_PTR:
    21052105        psError (__func__, "Can't copy image into a matrix of pointers.");
    2106         psImageFree (output);
     2106        psFree (output);
    21072107        return ((void *) 0);
    21082108    }
Note: See TracChangeset for help on using the changeset viewer.