Index: /trunk/psLib/psLib.kdevelop
===================================================================
--- /trunk/psLib/psLib.kdevelop	(revision 1072)
+++ /trunk/psLib/psLib.kdevelop	(revision 1073)
@@ -136,4 +136,5 @@
       <hidepatterns>*.o,*.lo,CVS</hidepatterns>
       <hidenonprojectfiles>false</hidenonprojectfiles>
+      <showvcsfields>false</showvcsfields>
     </tree>
   </kdevfileview>
@@ -144,3 +145,10 @@
     </filetemplates>
   </cppsupportpart>
+  <kdevcvsservice>
+    <recursivewhenupdate>true</recursivewhenupdate>
+    <prunedirswhenupdate>true</prunedirswhenupdate>
+    <createdirswhenupdate>true</createdirswhenupdate>
+    <recursivewhencommitremove>true</recursivewhencommitremove>
+    <revertoptions>-C</revertoptions>
+  </kdevcvsservice>
 </kdevelop>
Index: /trunk/psLib/psLib.kdevses
===================================================================
--- /trunk/psLib/psLib.kdevses	(revision 1072)
+++ /trunk/psLib/psLib.kdevses	(revision 1073)
@@ -2,5 +2,61 @@
 <!DOCTYPE KDevPrjSession>
 <KDevPrjSession>
- <DocsAndViews NumberOfDocuments="0" />
+ <DocsAndViews NumberOfDocuments="11" >
+  <Doc0 NumberOfViews="1" URL="file:/home/desonia/psLib/src/collections/psImage.c" >
+   <View0 line="0" Type="???" >
+    <AdditionalSettings Top="1" Width="1196" Attach="1" Height="861" Left="1" MinMaxMode="0" />
+   </View0>
+  </Doc0>
+  <Doc1 NumberOfViews="1" URL="file:/home/desonia/psLib/src/collections/psBitSet.c" >
+   <View0 line="107" Type="???" >
+    <AdditionalSettings Top="1" Width="1196" Attach="1" Height="832" Left="1" MinMaxMode="0" />
+   </View0>
+  </Doc1>
+  <Doc2 NumberOfViews="1" URL="file:/home/desonia/psLib/src/collections/psList.c" >
+   <View0 line="43" Type="???" >
+    <AdditionalSettings Top="1" Width="1196" Attach="1" Height="832" Left="1" MinMaxMode="0" />
+   </View0>
+  </Doc2>
+  <Doc3 NumberOfViews="1" URL="file:/home/desonia/psLib/src/collections/psVector.c" >
+   <View0 line="185" Type="???" >
+    <AdditionalSettings Top="1" Width="1196" Attach="1" Height="832" Left="1" MinMaxMode="0" />
+   </View0>
+  </Doc3>
+  <Doc4 NumberOfViews="1" URL="file:/home/desonia/psLib/src/collections/psVector.h" >
+   <View0 line="123" Type="???" >
+    <AdditionalSettings Top="1" Width="1196" Attach="1" Height="832" Left="1" MinMaxMode="0" />
+   </View0>
+  </Doc4>
+  <Doc5 NumberOfViews="1" URL="file:/home/desonia/psLib/src/dataManip/psFFT.c" >
+   <View0 line="0" Type="???" >
+    <AdditionalSettings Top="1" Width="1196" Attach="1" Height="631" Left="1" MinMaxMode="0" />
+   </View0>
+  </Doc5>
+  <Doc6 NumberOfViews="1" URL="file:/home/desonia/psLib/test/sysUtils/tst_psHash00.c" >
+   <View0 line="54" Type="???" >
+    <AdditionalSettings Top="1" Width="1196" Attach="1" Height="631" Left="1" MinMaxMode="0" />
+   </View0>
+  </Doc6>
+  <Doc7 NumberOfViews="1" URL="file:/home/desonia/psLib/test/sysUtils/tst_psHash01.c" >
+   <View0 line="41" Type="???" >
+    <AdditionalSettings Top="1" Width="1196" Attach="1" Height="631" Left="1" MinMaxMode="0" />
+   </View0>
+  </Doc7>
+  <Doc8 NumberOfViews="1" URL="file:/home/desonia/psLib/test/sysUtils/tst_psHash02.c" >
+   <View0 line="82" Type="???" >
+    <AdditionalSettings Top="1" Width="1196" Attach="1" Height="631" Left="1" MinMaxMode="0" />
+   </View0>
+  </Doc8>
+  <Doc9 NumberOfViews="1" URL="file:/home/desonia/psLib/test/sysUtils/tst_psHash03.c" >
+   <View0 line="122" Type="???" >
+    <AdditionalSettings Top="1" Width="1196" Attach="1" Height="631" Left="1" MinMaxMode="0" />
+   </View0>
+  </Doc9>
+  <Doc10 NumberOfViews="1" URL="file:/home/desonia/psLib/test/sysUtils/tst_psHash04.c" >
+   <View0 line="68" Type="???" >
+    <AdditionalSettings Top="1" Width="1196" Attach="1" Height="631" Left="1" MinMaxMode="0" />
+   </View0>
+  </Doc10>
+ </DocsAndViews>
  <pluginList>
   <kdevbookmarks>
Index: /trunk/psLib/src/collections/psBitSet.c
===================================================================
--- /trunk/psLib/src/collections/psBitSet.c	(revision 1072)
+++ /trunk/psLib/src/collections/psBitSet.c	(revision 1073)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-15 02:45:43 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -55,4 +55,6 @@
 /*  FUNCTION IMPLEMENTATION - LOCAL                                          */
 /*****************************************************************************/
+static void bitSetFree(psBitSet *restrict inBitSet);
+
 
 /** Private function to create a mask.
@@ -88,4 +90,5 @@
     numBytes = ceil(n/8.0);
     newObj = psAlloc(sizeof(psBitSet));
+    p_psMemSetDeallocator(newObj,(psFreeFcn)bitSetFree);
     newObj->n = numBytes;
 
@@ -98,5 +101,5 @@
 }
 
-void psBitSetFree(psBitSet *restrict inBitSet)
+static void bitSetFree(psBitSet *restrict inBitSet)
 {
     if(inBitSet == NULL) {
@@ -105,5 +108,4 @@
     }
     psFree(inBitSet->bits);
-    psFree(inBitSet);
 }
 
Index: /trunk/psLib/src/collections/psBitSet.h
===================================================================
--- /trunk/psLib/src/collections/psBitSet.h	(revision 1072)
+++ /trunk/psLib/src/collections/psBitSet.h	(revision 1073)
@@ -12,6 +12,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-10 01:58:06 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -54,12 +54,4 @@
 psBitSet* psBitSetAlloc(
     int n   /**< Number of bits in psBitSet array */
-);
-
-/** Free a psBitSet
- *
- *  Deletes a psBitSet array.
- */
-void psBitSetFree(
-    psBitSet *restrict inMask  /**< Pointer to psBitSet to be deleted. */
 );
 
Index: /trunk/psLib/src/collections/psList.c
===================================================================
--- /trunk/psLib/src/collections/psList.c	(revision 1072)
+++ /trunk/psLib/src/collections/psList.c	(revision 1073)
@@ -6,6 +6,6 @@
  *  @author Robert Daniel DeSonia, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-14 19:45:46 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -28,7 +28,8 @@
 
 // private functions.
-psListElem* listGetIterator(psList* list);
-int listGetIteratorIndex(psList* list);
-void listSetIterator(psList *list, int where, bool lockList);
+static psListElem* listGetIterator(psList* list);
+static int listGetIteratorIndex(psList* list);
+static void listSetIterator(psList *list, int where, bool lockList);
+static void listFree(psList *list);
 
 
@@ -36,4 +37,5 @@
 {
     psList *list = psAlloc(sizeof(psList));
+    p_psMemSetDeallocator(list,(psFreeFcn)listFree);
 
     list->size = 0;
@@ -41,4 +43,5 @@
     list->iter = ITER_INIT_HEAD;
     list->iterIndex = PS_LIST_HEAD;
+
     pthread_mutex_init(&(list->lock),NULL)
     ;
@@ -51,5 +54,5 @@
 }
 
-void psListFree(psList *list, psFreeFcn elemFree)
+static void listFree(psList *list)
 {
     if (list == NULL) {
@@ -63,5 +66,5 @@
         psListElem *next = ptr->next;
 
-        p_psCustomFree(elemFree, psMemDecrRefCounter(ptr->data));
+        psFree(ptr->data);
         psFree(ptr);
 
@@ -75,5 +78,4 @@
     ;
 
-    psFree(list);
 }
 
Index: /trunk/psLib/src/collections/psList.h
===================================================================
--- /trunk/psLib/src/collections/psList.h	(revision 1072)
+++ /trunk/psLib/src/collections/psList.h	(revision 1073)
@@ -10,6 +10,6 @@
  *  @ingroup LinkedList
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-12 22:15:39 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -73,15 +73,4 @@
 )
 ;
-
-#include "psMemory.h"
-/** Destroys a psList linked list object.  This also frees the elements of the
- *  list using the psFreeFcn given, if any.  If no psFreeFcn is specified,
- *  the elements are just dereferenced via psMemDecrRefCounter(...).
- *
- */
-void psListFree(
-    psList* restrict list,              ///< list to destroy
-    psFreeFcn elemFree                  ///< destructor for data on list
-);
 
 /** Adds an element to a psList at position given.
Index: /trunk/psLib/src/collections/psSort.c
===================================================================
--- /trunk/psLib/src/collections/psSort.c	(revision 1072)
+++ /trunk/psLib/src/collections/psSort.c	(revision 1073)
@@ -14,6 +14,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-10 23:15:08 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -33,4 +33,5 @@
 #include "psSort.h"
 #include "psError.h"
+#include "psMemory.h"
 
 /******************************************************************************/
@@ -242,5 +243,5 @@
 
     // Free temp memory
-    psVectorFree(tmpVector);
+    psFree(tmpVector);
 
     return outVector;
Index: /trunk/psLib/src/collections/psSort.d
===================================================================
--- /trunk/psLib/src/collections/psSort.d	(revision 1072)
+++ /trunk/psLib/src/collections/psSort.d	(revision 1073)
@@ -1,1 +1,2 @@
-psSort.o psSort.d : psSort.c psVector.h psType.h psSort.h ../sysUtils/psError.h
+psSort.o psSort.d : psSort.c psVector.h psType.h psSort.h ../sysUtils/psError.h \
+  ../sysUtils/psMemory.h
Index: /trunk/psLib/src/collections/psVector.c
===================================================================
--- /trunk/psLib/src/collections/psVector.c	(revision 1072)
+++ /trunk/psLib/src/collections/psVector.c	(revision 1073)
@@ -8,6 +8,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-12 01:33:16 $
+ *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -49,4 +49,5 @@
 /*  FUNCTION IMPLEMENTATION - LOCAL                                          */
 /*****************************************************************************/
+static void vectorFree(psVector *restrict psVec);
 
 /*****************************************************************************/
@@ -68,4 +69,5 @@
     // Create vector struct
     psVec = (psVector *)psAlloc(sizeof(psVector));
+    p_psMemSetDeallocator(psVec,(psFreeFcn)vectorFree);
 
     psVec->type.dimen = PS_DIMEN_VECTOR;
@@ -132,5 +134,5 @@
     if(nalloc < 1) {
         psError(__func__, "Invalid value for nalloc (%d)\n", nalloc);
-        psVectorFree(in);
+        psFree(in);
         return NULL;
     }
@@ -154,5 +156,5 @@
 }
 
-void psVectorFree(psVector *restrict psVec)
+static void vectorFree(psVector *restrict psVec)
 {
     if (psVec == NULL) {
@@ -160,9 +162,15 @@
     }
 
+    if (psVec->type.type == PS_TYPE_PTR) {
+        for(int i = 0; i < psVec->n; i++) {
+            psFree(psVec->data.PTR[i]);
+            psVec->data.PTR[i] = NULL;
+        }
+    }
+
     psFree(psVec->data.V);
-    psFree(psVec);
 }
 
-void psVectorElementFree(psVector *restrict psVec, void (*elemFree)(void *))
+void psVectorElementFree(psVector *restrict psVec)
 {
 
@@ -176,10 +184,6 @@
     }
 
-    for(int i = 0; i < psVec->nalloc; i++) {
-        if(elemFree == NULL) {
-            psMemDecrRefCounter(psVec->data.PTR[i]);
-        } else {
-            elemFree(psMemDecrRefCounter(psVec->data.PTR[i]));
-        }
+    for(int i = 0; i < psVec->n; i++) {
+        psFree(psVec->data.PTR[i]);
         psVec->data.PTR[i] = NULL;
     }
Index: /trunk/psLib/src/collections/psVector.h
===================================================================
--- /trunk/psLib/src/collections/psVector.h	(revision 1072)
+++ /trunk/psLib/src/collections/psVector.h	(revision 1073)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-10 01:58:06 $
+ *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -100,17 +100,4 @@
 );
 
-/** Deallocate a vector.
- *
- * Uses psLib memory allocation functions to deallocate a vector collection of data. The vector is deallocated
- * according to the psType type member contained within the vector.
- *
- * @return psVector*: Pointer to psVector.
- *
- */
-void psVectorFree(
-    psVector *restrict psVec  ///< Vector to free.
-);
-
-
 /** Deallocate/Dereference elements of a void pointer vector.
  *
@@ -122,6 +109,5 @@
  */
 void psVectorElementFree(
-    psVector *restrict psVec,   ///< Void pointer vector to destroy.
-    void (*elemFree)(void *)    ///< Optional callback function to remove vector elements.
+    psVector *restrict psVec    ///< Void pointer vector to destroy.
 );
 
Index: /trunk/psLib/src/dataManip/psFFT.c
===================================================================
--- /trunk/psLib/src/dataManip/psFFT.c	(revision 1072)
+++ /trunk/psLib/src/dataManip/psFFT.c	(revision 1073)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-12 02:17:25 $
+ *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -35,5 +35,5 @@
     /* got good image data? */
     if (in==NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -44,5 +44,5 @@
         psError(__func__,"Input image must be a 32-bit float or complex image (type=%d)",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -51,5 +51,5 @@
         psError(__func__,"Input image must be complex image for reverse FFT (type=%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
 
@@ -76,5 +76,5 @@
     if (plan == NULL) {
         psError(__func__,"Failed to create FFTW plan.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -98,5 +98,5 @@
 
     if (in == NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -143,5 +143,5 @@
         psError(__func__,"Can not extract real component from given image type (%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -158,5 +158,5 @@
 
     if (in == NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -205,5 +205,5 @@
         psError(__func__,"Can not extract imaginary component from given image type (%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -220,5 +220,5 @@
 
     if (real == NULL || imag == NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -230,5 +230,5 @@
     if (imag->type.type != type) {
         psError(__func__,"The inputs to psImageComplex must be the same type.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -237,5 +237,5 @@
             imag->numRows != numRows) {
         psError(__func__,"The inputs to psImageComplex must be the same dimensions.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -243,5 +243,5 @@
     if (PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"The inputs to psImageComplex can not be complex.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -249,5 +249,5 @@
     if (type != PS_TYPE_F32 && type != PS_TYPE_F64) {
         psError(__func__,"The input type to psImageComplex must be a floating point.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -287,5 +287,5 @@
         psError(__func__,"Can not merge real and imaginary portions for given image type (%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -302,5 +302,5 @@
 
     if (in == NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -347,5 +347,5 @@
         psError(__func__,"Can not compute complex conjugate for given image type (%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -362,5 +362,5 @@
 
     if (in == NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -374,5 +374,5 @@
     if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"Power Spectrum for non-complex inputs is not implemented.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -417,5 +417,5 @@
         psError(__func__,"Can not power spectrum for given image type (%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -435,5 +435,5 @@
     /* got good image data? */
     if (in==NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -444,5 +444,5 @@
         psError(__func__,"Input image must be a 32-bit float or complex image (type=%d)",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -451,5 +451,5 @@
         psError(__func__,"Input image must be complex image for reverse FFT (type=%d).",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
 
@@ -491,5 +491,5 @@
     if (plan == NULL) {
         psError(__func__,"Failed to create FFTW plan.");
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -510,5 +510,5 @@
 
     if (in == NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -542,5 +542,5 @@
         psError(__func__,"Can not extract real component from given vector type (%d).",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -556,5 +556,5 @@
 
     if (in == NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -588,5 +588,5 @@
         psError(__func__,"Can not extract imaginary component from given vector type (%d).",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -602,5 +602,5 @@
 
     if (real == NULL || imag == NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -615,5 +615,5 @@
     if (imag->type.type != type) {
         psError(__func__,"The inputs to psVectorComplex must be the same type.");
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -621,5 +621,5 @@
     if (PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"The inputs to psVectorComplex can not be complex.");
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -640,5 +640,5 @@
         psError(__func__,"Can not merge real and imaginary portions for given vector type (%d).",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -654,5 +654,5 @@
 
     if (in == NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -687,5 +687,5 @@
         psError(__func__,"Can not compute complex conjugate for given vector type (%d).",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -703,5 +703,5 @@
 
     if (in == NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -716,5 +716,5 @@
     if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"Power Spectrum for non-complex inputs is not implemented.");
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -747,9 +747,9 @@
         psError(__func__,"Can not power spectrum for given vector type (%d).",
                 type);
-        psVectorFree(out);
-        return NULL;
-    }
-
-    return out;
-
-}
+        psFree(out);
+        return NULL;
+    }
+
+    return out;
+
+}
Index: /trunk/psLib/src/dataManip/psFunctions.c
===================================================================
--- /trunk/psLib/src/dataManip/psFunctions.c	(revision 1072)
+++ /trunk/psLib/src/dataManip/psFunctions.c	(revision 1073)
@@ -7,6 +7,6 @@
  *  polynomials.  It also contains a Gaussian functions.
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-14 19:40:14 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -34,4 +34,14 @@
 #include <gsl/gsl_rng.h>
 #include <gsl/gsl_randist.h>
+
+static void polynomial1DFree(psPolynomial1D *myPoly);
+static void polynomial2DFree(psPolynomial2D *myPoly);
+static void polynomial3DFree(psPolynomial3D *myPoly);
+static void polynomial4DFree(psPolynomial4D *myPoly);
+static void dPolynomial1DFree(psDPolynomial1D *myPoly);
+static void dPolynomial2DFree(psDPolynomial2D *myPoly);
+static void dPolynomial3DFree(psDPolynomial3D *myPoly);
+static void dPolynomial4DFree(psDPolynomial4D *myPoly);
+
 /*****************************************************************************/
 /*  FUNCTION IMPLEMENTATION - PUBLIC                                         */
@@ -108,4 +118,5 @@
 
     newPoly = (psPolynomial1D *) psAlloc(sizeof(psPolynomial1D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)polynomial1DFree);
     newPoly->n = n;
     newPoly->coeff    = (float *) psAlloc(n * sizeof(float));
@@ -128,4 +139,5 @@
 
     newPoly = (psPolynomial2D *) psAlloc(sizeof(psPolynomial2D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)polynomial2DFree);
     newPoly->nX = nX;
     newPoly->nY = nY;
@@ -158,4 +170,5 @@
 
     newPoly = (psPolynomial3D *) psAlloc(sizeof(psPolynomial3D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)polynomial3DFree);
     newPoly->nX = nX;
     newPoly->nY = nY;
@@ -197,4 +210,5 @@
 
     newPoly = (psPolynomial4D *) psAlloc(sizeof(psPolynomial4D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)polynomial4DFree);
     newPoly->nW = nW;
     newPoly->nX = nX;
@@ -235,13 +249,12 @@
 }
 
-void psPolynomial1DFree(psPolynomial1D *myPoly)
+static void polynomial1DFree(psPolynomial1D *myPoly)
 {
     psFree(myPoly->coeff);
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
-}
-
-void psPolynomial2DFree(psPolynomial2D *myPoly)
+}
+
+static void polynomial2DFree(psPolynomial2D *myPoly)
 {
     int x = 0;
@@ -255,9 +268,7 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-
-    psFree(myPoly);
-}
-
-void psPolynomial3DFree(psPolynomial3D *myPoly)
+}
+
+static void polynomial3DFree(psPolynomial3D *myPoly)
 {
     int x = 0;
@@ -278,8 +289,7 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
-}
-
-void psPolynomial4DFree(psPolynomial4D *myPoly)
+}
+
+static void polynomial4DFree(psPolynomial4D *myPoly)
 {
     int w = 0;
@@ -306,5 +316,4 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
 }
 
@@ -434,4 +443,5 @@
 
     newPoly = (psDPolynomial1D *) psAlloc(sizeof(psDPolynomial1D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)dPolynomial1DFree);
     newPoly->n = n;
     newPoly->coeff    = (double *) psAlloc(n * sizeof(double));
@@ -454,4 +464,5 @@
 
     newPoly = (psDPolynomial2D *) psAlloc(sizeof(psDPolynomial2D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)dPolynomial2DFree);
     newPoly->nX = nX;
     newPoly->nY = nY;
@@ -484,4 +495,5 @@
 
     newPoly = (psDPolynomial3D *) psAlloc(sizeof(psDPolynomial3D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)dPolynomial3DFree);
     newPoly->nX = nX;
     newPoly->nY = nY;
@@ -523,4 +535,5 @@
 
     newPoly = (psDPolynomial4D *) psAlloc(sizeof(psDPolynomial4D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)dPolynomial4DFree);
     newPoly->nW = nW;
     newPoly->nX = nX;
@@ -561,13 +574,12 @@
 }
 
-void psDPolynomial1DFree(psDPolynomial1D *myPoly)
+static void dPolynomial1DFree(psDPolynomial1D *myPoly)
 {
     psFree(myPoly->coeff);
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
-}
-
-void psDPolynomial2DFree(psDPolynomial2D *myPoly)
+}
+
+static void dPolynomial2DFree(psDPolynomial2D *myPoly)
 {
     int x = 0;
@@ -581,9 +593,7 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-
-    psFree(myPoly);
-}
-
-void psDPolynomial3DFree(psDPolynomial3D *myPoly)
+}
+
+static void dPolynomial3DFree(psDPolynomial3D *myPoly)
 {
     int x = 0;
@@ -604,8 +614,7 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
-}
-
-void psDPolynomial4DFree(psDPolynomial4D *myPoly)
+}
+
+static void dPolynomial4DFree(psDPolynomial4D *myPoly)
 {
     int w = 0;
@@ -632,5 +641,4 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
 }
 
Index: /trunk/psLib/src/dataManip/psFunctions.h
===================================================================
--- /trunk/psLib/src/dataManip/psFunctions.h	(revision 1072)
+++ /trunk/psLib/src/dataManip/psFunctions.h	(revision 1073)
@@ -12,6 +12,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-14 19:32:42 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -104,19 +104,4 @@
                                    );
 
-/** Destructor */
-void psPolynomial1DFree(psPolynomial1D *myPoly ///< Polynomial to destroy
-                       );
-
-/** Destructor */
-void psPolynomial2DFree(psPolynomial2D *myPoly ///< Polynomial to destroy
-                       );
-/** Destructor */
-void psPolynomial3DFree(psPolynomial3D *myPoly ///< Polynomial to destroy
-                       );
-/** Destructor */
-void psPolynomial4DFree(psPolynomial4D *myPoly ///< Polynomial to destroy
-                       );
-
-
 /** Evaluate 1D polynomial */
 float
@@ -206,19 +191,4 @@
                                      );
 
-
-/** Destructor */
-void psDPolynomial1DFree(psDPolynomial1D *myPoly ///< Polynomial to destroy
-                        );
-/** Destructor */
-void psDPolynomial2DFree(psDPolynomial2D *myPoly ///< Polynomial to destroy
-                        );
-/** Destructor */
-void psDPolynomial3DFree(psDPolynomial3D *myPoly ///< Polynomial to destroy
-                        );
-/** Destructor */
-void psDPolynomial4DFree(psDPolynomial4D *myPoly ///< Polynomial to destroy
-                        );
-
-
 /** Evaluate 1D polynomial (double precision) */
 double
Index: /trunk/psLib/src/dataManip/psStats.c
===================================================================
--- /trunk/psLib/src/dataManip/psStats.c	(revision 1072)
+++ /trunk/psLib/src/dataManip/psStats.c	(revision 1073)
@@ -32,4 +32,6 @@
                            psStats *stats);
 #endif
+
+static void histogramFree(psHistogram *myHist);
 
 /******************************************************************************
@@ -68,12 +70,4 @@
 
 /******************************************************************************
-    psStatsFree(): This routine must free the psStats data structure.
- *****************************************************************************/
-void psStatsFree(psStats *stats)
-{
-    psFree(stats);
-}
-
-/******************************************************************************
 psHistogramAlloc(lower, upper, n): allocate a uniform histogram structure
 with the specifed upper and lower limits, and the specifed number of bins.
@@ -108,4 +102,5 @@
     // bins, then there are N+1 bounds to those bins.
     newHist = (psHistogram *) psAlloc(sizeof(psHistogram));
+    p_psMemSetDeallocator(newHist,(psFreeFcn)histogramFree);
     newHist->bounds = psVectorAlloc(n+1, PS_TYPE_F32);
     newHist->bounds->n = newHist->bounds->nalloc;
@@ -160,4 +155,5 @@
     // Allocate memory for the new histogram structure.
     newHist = (psHistogram *) psAlloc(sizeof(psHistogram));
+    p_psMemSetDeallocator(newHist,(psFreeFcn)histogramFree);
     newHist->bounds = psVectorAlloc(bounds->n, PS_TYPE_F32);
     newHist->bounds->n = newHist->bounds->nalloc;
@@ -182,9 +178,8 @@
 }
 
-void psHistogramFree(psHistogram *myHist)
-{
-    psVectorFree(myHist->bounds);
-    psVectorFree(myHist->nums);
-    psFree(myHist);
+static void histogramFree(psHistogram *myHist)
+{
+    psFree(myHist->bounds);
+    psFree(myHist->nums);
 }
 
@@ -618,5 +613,5 @@
 
         // Free temporary data buffers.
-        psStatsFree(stats2);
+        psFree(stats2);
 
         // Set the PS_STAT_ROBUST_FOR_SAMPLE bit in the stats structure.
@@ -688,6 +683,6 @@
 
     // Free the temporary data structures.
-    psVectorFree(unsortedVector);
-    psVectorFree(sortedVector);
+    psFree(unsortedVector);
+    psFree(sortedVector);
 }
 
@@ -775,5 +770,5 @@
 
         // Free temporary data buffers.
-        psStatsFree(stats2);
+        psFree(stats2);
 
         // Set the PS_STAT_ROBUST_FOR_SAMPLE bit in the stats structure.
@@ -840,6 +835,6 @@
 
     // Free the temporary data structures.
-    psVectorFree(unsortedVector);
-    psVectorFree(sortedVector);
+    psFree(unsortedVector);
+    psFree(sortedVector);
     // NOTE: This is the
 }
@@ -1043,5 +1038,5 @@
     }
 
-    psVectorFree(tmpMask);
+    psFree(tmpMask);
 }
 
@@ -1125,6 +1120,6 @@
             stats->robustLQ = stats->clippedMean;
         }
-        psStatsFree(tmpStats);
-        psHistogramFree(robustHistogram);
+        psFree(tmpStats);
+        psFree(robustHistogram);
         return;
     }
@@ -1200,6 +1195,6 @@
     stats->robustNfit = 0.0;
     stats->robustN50 = 0.0;
-    psStatsFree(tmpStats);
-    psHistogramFree(robustHistogram);
+    psFree(tmpStats);
+    psFree(robustHistogram);
 }
 
Index: /trunk/psLib/src/dataManip/psStats.h
===================================================================
--- /trunk/psLib/src/dataManip/psStats.h	(revision 1072)
+++ /trunk/psLib/src/dataManip/psStats.h	(revision 1073)
@@ -9,6 +9,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-14 19:33:09 $
+ *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -88,7 +88,4 @@
 psStats *psStatsAlloc(psStatsOptions options); ///< Statistics to measure
 
-/** A destructor for the stats structure.*/
-void psStatsFree(psStats *restrict stats); ///< Stats structure to destroy
-
 /******************************************************************************
     Histogram functions and data structures.
@@ -116,9 +113,4 @@
 psHistogram * psHistogramAllocGeneric(const psVector *restrict bounds); ///< Bounds for the bins
 
-
-/** Destructor \ingroup MathGroup **/
-void psHistogramFree(psHistogram *myHist);          ///< Histogram to destroy
-
-
 /** Calculate a histogram \ingroup MathGroup **/
 psHistogram *psHistogramVector (psHistogram *out,   ///< Histogram data
Index: /trunk/psLib/src/dataManip/psVectorFFT.c
===================================================================
--- /trunk/psLib/src/dataManip/psVectorFFT.c	(revision 1072)
+++ /trunk/psLib/src/dataManip/psVectorFFT.c	(revision 1073)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-12 02:17:25 $
+ *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -35,5 +35,5 @@
     /* got good image data? */
     if (in==NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -44,5 +44,5 @@
         psError(__func__,"Input image must be a 32-bit float or complex image (type=%d)",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -51,5 +51,5 @@
         psError(__func__,"Input image must be complex image for reverse FFT (type=%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
 
@@ -76,5 +76,5 @@
     if (plan == NULL) {
         psError(__func__,"Failed to create FFTW plan.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -98,5 +98,5 @@
 
     if (in == NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -143,5 +143,5 @@
         psError(__func__,"Can not extract real component from given image type (%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -158,5 +158,5 @@
 
     if (in == NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -205,5 +205,5 @@
         psError(__func__,"Can not extract imaginary component from given image type (%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -220,5 +220,5 @@
 
     if (real == NULL || imag == NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -230,5 +230,5 @@
     if (imag->type.type != type) {
         psError(__func__,"The inputs to psImageComplex must be the same type.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -237,5 +237,5 @@
             imag->numRows != numRows) {
         psError(__func__,"The inputs to psImageComplex must be the same dimensions.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -243,5 +243,5 @@
     if (PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"The inputs to psImageComplex can not be complex.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -249,5 +249,5 @@
     if (type != PS_TYPE_F32 && type != PS_TYPE_F64) {
         psError(__func__,"The input type to psImageComplex must be a floating point.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -287,5 +287,5 @@
         psError(__func__,"Can not merge real and imaginary portions for given image type (%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -302,5 +302,5 @@
 
     if (in == NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -347,5 +347,5 @@
         psError(__func__,"Can not compute complex conjugate for given image type (%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -362,5 +362,5 @@
 
     if (in == NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -374,5 +374,5 @@
     if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"Power Spectrum for non-complex inputs is not implemented.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -417,5 +417,5 @@
         psError(__func__,"Can not power spectrum for given image type (%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -435,5 +435,5 @@
     /* got good image data? */
     if (in==NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -444,5 +444,5 @@
         psError(__func__,"Input image must be a 32-bit float or complex image (type=%d)",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -451,5 +451,5 @@
         psError(__func__,"Input image must be complex image for reverse FFT (type=%d).",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
 
@@ -491,5 +491,5 @@
     if (plan == NULL) {
         psError(__func__,"Failed to create FFTW plan.");
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -510,5 +510,5 @@
 
     if (in == NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -542,5 +542,5 @@
         psError(__func__,"Can not extract real component from given vector type (%d).",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -556,5 +556,5 @@
 
     if (in == NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -588,5 +588,5 @@
         psError(__func__,"Can not extract imaginary component from given vector type (%d).",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -602,5 +602,5 @@
 
     if (real == NULL || imag == NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -615,5 +615,5 @@
     if (imag->type.type != type) {
         psError(__func__,"The inputs to psVectorComplex must be the same type.");
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -621,5 +621,5 @@
     if (PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"The inputs to psVectorComplex can not be complex.");
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -640,5 +640,5 @@
         psError(__func__,"Can not merge real and imaginary portions for given vector type (%d).",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -654,5 +654,5 @@
 
     if (in == NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -687,5 +687,5 @@
         psError(__func__,"Can not compute complex conjugate for given vector type (%d).",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -703,5 +703,5 @@
 
     if (in == NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -716,5 +716,5 @@
     if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"Power Spectrum for non-complex inputs is not implemented.");
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -747,9 +747,9 @@
         psError(__func__,"Can not power spectrum for given vector type (%d).",
                 type);
-        psVectorFree(out);
-        return NULL;
-    }
-
-    return out;
-
-}
+        psFree(out);
+        return NULL;
+    }
+
+    return out;
+
+}
Index: /trunk/psLib/src/fft/psVectorFFT.c
===================================================================
--- /trunk/psLib/src/fft/psVectorFFT.c	(revision 1072)
+++ /trunk/psLib/src/fft/psVectorFFT.c	(revision 1073)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-12 02:17:25 $
+ *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -35,5 +35,5 @@
     /* got good image data? */
     if (in==NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -44,5 +44,5 @@
         psError(__func__,"Input image must be a 32-bit float or complex image (type=%d)",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -51,5 +51,5 @@
         psError(__func__,"Input image must be complex image for reverse FFT (type=%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
 
@@ -76,5 +76,5 @@
     if (plan == NULL) {
         psError(__func__,"Failed to create FFTW plan.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -98,5 +98,5 @@
 
     if (in == NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -143,5 +143,5 @@
         psError(__func__,"Can not extract real component from given image type (%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -158,5 +158,5 @@
 
     if (in == NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -205,5 +205,5 @@
         psError(__func__,"Can not extract imaginary component from given image type (%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -220,5 +220,5 @@
 
     if (real == NULL || imag == NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -230,5 +230,5 @@
     if (imag->type.type != type) {
         psError(__func__,"The inputs to psImageComplex must be the same type.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -237,5 +237,5 @@
             imag->numRows != numRows) {
         psError(__func__,"The inputs to psImageComplex must be the same dimensions.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -243,5 +243,5 @@
     if (PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"The inputs to psImageComplex can not be complex.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -249,5 +249,5 @@
     if (type != PS_TYPE_F32 && type != PS_TYPE_F64) {
         psError(__func__,"The input type to psImageComplex must be a floating point.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -287,5 +287,5 @@
         psError(__func__,"Can not merge real and imaginary portions for given image type (%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -302,5 +302,5 @@
 
     if (in == NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -347,5 +347,5 @@
         psError(__func__,"Can not compute complex conjugate for given image type (%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -362,5 +362,5 @@
 
     if (in == NULL) {
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -374,5 +374,5 @@
     if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"Power Spectrum for non-complex inputs is not implemented.");
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -417,5 +417,5 @@
         psError(__func__,"Can not power spectrum for given image type (%d).",
                 type);
-        psImageFree(out);
+        psFree(out);
         return NULL;
     }
@@ -435,5 +435,5 @@
     /* got good image data? */
     if (in==NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -444,5 +444,5 @@
         psError(__func__,"Input image must be a 32-bit float or complex image (type=%d)",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -451,5 +451,5 @@
         psError(__func__,"Input image must be complex image for reverse FFT (type=%d).",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
 
@@ -491,5 +491,5 @@
     if (plan == NULL) {
         psError(__func__,"Failed to create FFTW plan.");
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -510,5 +510,5 @@
 
     if (in == NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -542,5 +542,5 @@
         psError(__func__,"Can not extract real component from given vector type (%d).",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -556,5 +556,5 @@
 
     if (in == NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -588,5 +588,5 @@
         psError(__func__,"Can not extract imaginary component from given vector type (%d).",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -602,5 +602,5 @@
 
     if (real == NULL || imag == NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -615,5 +615,5 @@
     if (imag->type.type != type) {
         psError(__func__,"The inputs to psVectorComplex must be the same type.");
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -621,5 +621,5 @@
     if (PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"The inputs to psVectorComplex can not be complex.");
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -640,5 +640,5 @@
         psError(__func__,"Can not merge real and imaginary portions for given vector type (%d).",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -654,5 +654,5 @@
 
     if (in == NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -687,5 +687,5 @@
         psError(__func__,"Can not compute complex conjugate for given vector type (%d).",
                 type);
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -703,5 +703,5 @@
 
     if (in == NULL) {
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -716,5 +716,5 @@
     if (! PS_IS_PSELEMTYPE_COMPLEX(type)) {
         psError(__func__,"Power Spectrum for non-complex inputs is not implemented.");
-        psVectorFree(out);
+        psFree(out);
         return NULL;
     }
@@ -747,9 +747,9 @@
         psError(__func__,"Can not power spectrum for given vector type (%d).",
                 type);
-        psVectorFree(out);
-        return NULL;
-    }
-
-    return out;
-
-}
+        psFree(out);
+        return NULL;
+    }
+
+    return out;
+
+}
Index: /trunk/psLib/src/image/psImage.c
===================================================================
--- /trunk/psLib/src/image/psImage.c	(revision 1072)
+++ /trunk/psLib/src/image/psImage.c	(revision 1073)
@@ -9,6 +9,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-11 02:02:53 $
+ *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -28,4 +28,5 @@
 #include "psImage.h"
 
+static void imageFree(psImage* image);
 
 /*****************************************************************************/
@@ -49,4 +50,5 @@
 
     psImage *image = (psImage *)psAlloc(sizeof(psImage));
+    p_psMemSetDeallocator(image,(psFreeFcn)imageFree);
 
     image->data.V = psAlloc(sizeof(void*)*numRows);
@@ -71,5 +73,5 @@
 }
 
-void psImageFree(psImage *image)
+static void imageFree(psImage* image)
 {
     if (image == NULL) {
@@ -96,6 +98,4 @@
     psFree(image->data.V);
     image->data.V = NULL;
-
-    psFree(image);
 }
 
@@ -237,5 +237,5 @@
         if (children[i] != NULL) {
             numFreed++;
-            psImageFree(children[i]);
+            psFree(children[i]);
         }
     }
@@ -341,5 +341,5 @@
     case PS_TYPE_PTR: \
         psError(__func__,"Can't copy image from a matrix of pointers."); \
-        psImageFree(output); \
+        psFree(output); \
         return NULL; \
     default: \
@@ -391,5 +391,5 @@
     case PS_TYPE_PTR:
         psError(__func__,"Can't copy image into a matrix of pointers.");
-        psImageFree(output);
+        psFree(output);
         return NULL;
     }
@@ -534,5 +534,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -676,5 +676,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -818,5 +818,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -960,5 +960,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -1102,5 +1102,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -1244,5 +1244,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -1386,5 +1386,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -1528,5 +1528,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -1670,5 +1670,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -1812,5 +1812,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -1954,5 +1954,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -2096,5 +2096,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -2104,5 +2104,5 @@
     case PS_TYPE_PTR:
         psError (__func__, "Can't copy image into a matrix of pointers.");
-        psImageFree (output);
+        psFree (output);
         return ((void *) 0);
     }
Index: /trunk/psLib/src/image/psImage.h
===================================================================
--- /trunk/psLib/src/image/psImage.h	(revision 1072)
+++ /trunk/psLib/src/image/psImage.h	(revision 1073)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-10 01:58:06 $
+ *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -110,14 +110,4 @@
 );
 
-/** Destroy the specified image.
- *
- *  Uses psLib memory deallocation functions to free an image and any existing
- *  children.
- *
- */
-void psImageFree(
-    psImage *restrict image             ///< Free psImage
-);
-
 /** Frees all children of a psImage.
  *
Index: /trunk/psLib/src/image/psImageIO.c
===================================================================
--- /trunk/psLib/src/image/psImageIO.c	(revision 1072)
+++ /trunk/psLib/src/image/psImageIO.c	(revision 1073)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-11 03:45:07 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -19,4 +19,5 @@
 #include "psImageIO.h"
 #include "psError.h"
+#include "psMemory.h"
 
 psImage* psImageReadSection(psImage* output, int col, int row, int numCols,
@@ -39,5 +40,5 @@
     if (filename == NULL) {
         psError(__func__,"Must specify filename; it can not be NULL.");
-        psImageFree(output);
+        psFree(output);
         return NULL;
     }
@@ -49,5 +50,5 @@
         psError(__func__,"Could not open file '%s'. (%s)",
                 filename, fitsErr);
-        psImageFree(output);
+        psFree(output);
         return NULL;
     }
@@ -61,5 +62,5 @@
             psError(__func__,"Could not index to '%s' HDU for file %s. (%s)",
                     extname, filename, fitsErr);
-            psImageFree(output);
+            psFree(output);
             return NULL;
         }
@@ -71,5 +72,5 @@
             psError(__func__,"Could not index to HDU #%d for file %s. (%s)",
                     extnum, filename, fitsErr);
-            psImageFree(output);
+            psFree(output);
             return NULL;
         }
@@ -83,5 +84,5 @@
         psError("Could not determine image data type of '%s'. (%s)",
                 filename, fitsErr);
-        psImageFree(output);
+        psFree(output);
         return NULL;
     }
@@ -94,5 +95,5 @@
         psError("Could not determine dimensions of '%s'. (%s)",
                 filename,fitsErr);
-        psImageFree(output);
+        psFree(output);
         return NULL;
     }
@@ -104,5 +105,5 @@
         psError("Dimensions of '%s' are not supported (NAXIS=%i).",
                 filename, nAxis);
-        psImageFree(output);
+        psFree(output);
         return NULL;
     }
@@ -115,5 +116,5 @@
         psError("Could not determine image size of '%s'. (%s)",
                 filename,fitsErr);
-        psImageFree(output);
+        psFree(output);
         return NULL;
     }
@@ -181,5 +182,5 @@
         psError(__func__,"Unsupported bitpix value (%d) in FITS file %s.",
                 bitPix,filename);
-        psImageFree(output);
+        psFree(output);
         return NULL;
     }
@@ -187,5 +188,5 @@
     if (fits_read_subset(fptr, fitsDatatype, firstPixel, lastPixel, increment,
                          NULL, output->data.V[0], &anynull, &status) != 0) {
-        psImageFree(output);
+        psFree(output);
         (void)fits_get_errstatus(status, fitsErr);
         status = 0;
Index: /trunk/psLib/src/image/psImageIO.d
===================================================================
--- /trunk/psLib/src/image/psImageIO.d	(revision 1072)
+++ /trunk/psLib/src/image/psImageIO.d	(revision 1073)
@@ -1,2 +1,2 @@
 psImageIO.o psImageIO.d : psImageIO.c psImageIO.h ../collections/psImage.h \
-  ../collections/psType.h ../sysUtils/psError.h
+  ../collections/psType.h ../sysUtils/psError.h ../sysUtils/psMemory.h
Index: /trunk/psLib/src/image/psImageStats.c
===================================================================
--- /trunk/psLib/src/image/psImageStats.c	(revision 1072)
+++ /trunk/psLib/src/image/psImageStats.c	(revision 1073)
@@ -67,9 +67,9 @@
 
         stats = psVectorStats(stats, junkData, junkMask, maskVal);
-        psVectorFree(junkMask);
+        psFree(junkMask);
     } else {
         stats = psVectorStats(stats, junkData, NULL, 0);
     }
-    psVectorFree(junkData);
+    psFree(junkData);
     return(stats);
 }
@@ -129,9 +129,9 @@
         }
         out = psHistogramVector(out, junkData, junkMask, maskVal);
-        psVectorFree(junkMask);
+        psFree(junkMask);
     } else {
         out = psHistogramVector(out, junkData, NULL, 0);
     }
-    psVectorFree(junkData);
+    psFree(junkData);
 
     return(out);
@@ -339,5 +339,5 @@
     // Free the Chebyshev polynomials that were created in this routine.
     for (i=0;i<maxChebyPoly;i++) {
-        psPolynomial1DFree(chebPolys[i]);
+        psFree(chebPolys[i]);
     }
     psFree(chebPolys);
@@ -413,5 +413,5 @@
     // Free the Chebyshev polynomials that were created in this routine.
     for (i=0;i<maxChebyPoly;i++) {
-        psPolynomial1DFree(chebPolys[i]);
+        psFree(chebPolys[i]);
     }
     psFree(chebPolys);
Index: /trunk/psLib/src/imageops/psImageStats.c
===================================================================
--- /trunk/psLib/src/imageops/psImageStats.c	(revision 1072)
+++ /trunk/psLib/src/imageops/psImageStats.c	(revision 1073)
@@ -67,9 +67,9 @@
 
         stats = psVectorStats(stats, junkData, junkMask, maskVal);
-        psVectorFree(junkMask);
+        psFree(junkMask);
     } else {
         stats = psVectorStats(stats, junkData, NULL, 0);
     }
-    psVectorFree(junkData);
+    psFree(junkData);
     return(stats);
 }
@@ -129,9 +129,9 @@
         }
         out = psHistogramVector(out, junkData, junkMask, maskVal);
-        psVectorFree(junkMask);
+        psFree(junkMask);
     } else {
         out = psHistogramVector(out, junkData, NULL, 0);
     }
-    psVectorFree(junkData);
+    psFree(junkData);
 
     return(out);
@@ -339,5 +339,5 @@
     // Free the Chebyshev polynomials that were created in this routine.
     for (i=0;i<maxChebyPoly;i++) {
-        psPolynomial1DFree(chebPolys[i]);
+        psFree(chebPolys[i]);
     }
     psFree(chebPolys);
@@ -413,5 +413,5 @@
     // Free the Chebyshev polynomials that were created in this routine.
     for (i=0;i<maxChebyPoly;i++) {
-        psPolynomial1DFree(chebPolys[i]);
+        psFree(chebPolys[i]);
     }
     psFree(chebPolys);
Index: /trunk/psLib/src/math/psPolynomial.c
===================================================================
--- /trunk/psLib/src/math/psPolynomial.c	(revision 1072)
+++ /trunk/psLib/src/math/psPolynomial.c	(revision 1073)
@@ -7,6 +7,6 @@
  *  polynomials.  It also contains a Gaussian functions.
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-14 19:40:14 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -34,4 +34,14 @@
 #include <gsl/gsl_rng.h>
 #include <gsl/gsl_randist.h>
+
+static void polynomial1DFree(psPolynomial1D *myPoly);
+static void polynomial2DFree(psPolynomial2D *myPoly);
+static void polynomial3DFree(psPolynomial3D *myPoly);
+static void polynomial4DFree(psPolynomial4D *myPoly);
+static void dPolynomial1DFree(psDPolynomial1D *myPoly);
+static void dPolynomial2DFree(psDPolynomial2D *myPoly);
+static void dPolynomial3DFree(psDPolynomial3D *myPoly);
+static void dPolynomial4DFree(psDPolynomial4D *myPoly);
+
 /*****************************************************************************/
 /*  FUNCTION IMPLEMENTATION - PUBLIC                                         */
@@ -108,4 +118,5 @@
 
     newPoly = (psPolynomial1D *) psAlloc(sizeof(psPolynomial1D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)polynomial1DFree);
     newPoly->n = n;
     newPoly->coeff    = (float *) psAlloc(n * sizeof(float));
@@ -128,4 +139,5 @@
 
     newPoly = (psPolynomial2D *) psAlloc(sizeof(psPolynomial2D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)polynomial2DFree);
     newPoly->nX = nX;
     newPoly->nY = nY;
@@ -158,4 +170,5 @@
 
     newPoly = (psPolynomial3D *) psAlloc(sizeof(psPolynomial3D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)polynomial3DFree);
     newPoly->nX = nX;
     newPoly->nY = nY;
@@ -197,4 +210,5 @@
 
     newPoly = (psPolynomial4D *) psAlloc(sizeof(psPolynomial4D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)polynomial4DFree);
     newPoly->nW = nW;
     newPoly->nX = nX;
@@ -235,13 +249,12 @@
 }
 
-void psPolynomial1DFree(psPolynomial1D *myPoly)
+static void polynomial1DFree(psPolynomial1D *myPoly)
 {
     psFree(myPoly->coeff);
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
-}
-
-void psPolynomial2DFree(psPolynomial2D *myPoly)
+}
+
+static void polynomial2DFree(psPolynomial2D *myPoly)
 {
     int x = 0;
@@ -255,9 +268,7 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-
-    psFree(myPoly);
-}
-
-void psPolynomial3DFree(psPolynomial3D *myPoly)
+}
+
+static void polynomial3DFree(psPolynomial3D *myPoly)
 {
     int x = 0;
@@ -278,8 +289,7 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
-}
-
-void psPolynomial4DFree(psPolynomial4D *myPoly)
+}
+
+static void polynomial4DFree(psPolynomial4D *myPoly)
 {
     int w = 0;
@@ -306,5 +316,4 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
 }
 
@@ -434,4 +443,5 @@
 
     newPoly = (psDPolynomial1D *) psAlloc(sizeof(psDPolynomial1D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)dPolynomial1DFree);
     newPoly->n = n;
     newPoly->coeff    = (double *) psAlloc(n * sizeof(double));
@@ -454,4 +464,5 @@
 
     newPoly = (psDPolynomial2D *) psAlloc(sizeof(psDPolynomial2D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)dPolynomial2DFree);
     newPoly->nX = nX;
     newPoly->nY = nY;
@@ -484,4 +495,5 @@
 
     newPoly = (psDPolynomial3D *) psAlloc(sizeof(psDPolynomial3D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)dPolynomial3DFree);
     newPoly->nX = nX;
     newPoly->nY = nY;
@@ -523,4 +535,5 @@
 
     newPoly = (psDPolynomial4D *) psAlloc(sizeof(psDPolynomial4D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)dPolynomial4DFree);
     newPoly->nW = nW;
     newPoly->nX = nX;
@@ -561,13 +574,12 @@
 }
 
-void psDPolynomial1DFree(psDPolynomial1D *myPoly)
+static void dPolynomial1DFree(psDPolynomial1D *myPoly)
 {
     psFree(myPoly->coeff);
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
-}
-
-void psDPolynomial2DFree(psDPolynomial2D *myPoly)
+}
+
+static void dPolynomial2DFree(psDPolynomial2D *myPoly)
 {
     int x = 0;
@@ -581,9 +593,7 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-
-    psFree(myPoly);
-}
-
-void psDPolynomial3DFree(psDPolynomial3D *myPoly)
+}
+
+static void dPolynomial3DFree(psDPolynomial3D *myPoly)
 {
     int x = 0;
@@ -604,8 +614,7 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
-}
-
-void psDPolynomial4DFree(psDPolynomial4D *myPoly)
+}
+
+static void dPolynomial4DFree(psDPolynomial4D *myPoly)
 {
     int w = 0;
@@ -632,5 +641,4 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
 }
 
Index: /trunk/psLib/src/math/psPolynomial.h
===================================================================
--- /trunk/psLib/src/math/psPolynomial.h	(revision 1072)
+++ /trunk/psLib/src/math/psPolynomial.h	(revision 1073)
@@ -12,6 +12,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-14 19:32:42 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -104,19 +104,4 @@
                                    );
 
-/** Destructor */
-void psPolynomial1DFree(psPolynomial1D *myPoly ///< Polynomial to destroy
-                       );
-
-/** Destructor */
-void psPolynomial2DFree(psPolynomial2D *myPoly ///< Polynomial to destroy
-                       );
-/** Destructor */
-void psPolynomial3DFree(psPolynomial3D *myPoly ///< Polynomial to destroy
-                       );
-/** Destructor */
-void psPolynomial4DFree(psPolynomial4D *myPoly ///< Polynomial to destroy
-                       );
-
-
 /** Evaluate 1D polynomial */
 float
@@ -206,19 +191,4 @@
                                      );
 
-
-/** Destructor */
-void psDPolynomial1DFree(psDPolynomial1D *myPoly ///< Polynomial to destroy
-                        );
-/** Destructor */
-void psDPolynomial2DFree(psDPolynomial2D *myPoly ///< Polynomial to destroy
-                        );
-/** Destructor */
-void psDPolynomial3DFree(psDPolynomial3D *myPoly ///< Polynomial to destroy
-                        );
-/** Destructor */
-void psDPolynomial4DFree(psDPolynomial4D *myPoly ///< Polynomial to destroy
-                        );
-
-
 /** Evaluate 1D polynomial (double precision) */
 double
Index: /trunk/psLib/src/math/psSpline.c
===================================================================
--- /trunk/psLib/src/math/psSpline.c	(revision 1072)
+++ /trunk/psLib/src/math/psSpline.c	(revision 1073)
@@ -7,6 +7,6 @@
  *  polynomials.  It also contains a Gaussian functions.
  *
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-14 19:40:14 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -34,4 +34,14 @@
 #include <gsl/gsl_rng.h>
 #include <gsl/gsl_randist.h>
+
+static void polynomial1DFree(psPolynomial1D *myPoly);
+static void polynomial2DFree(psPolynomial2D *myPoly);
+static void polynomial3DFree(psPolynomial3D *myPoly);
+static void polynomial4DFree(psPolynomial4D *myPoly);
+static void dPolynomial1DFree(psDPolynomial1D *myPoly);
+static void dPolynomial2DFree(psDPolynomial2D *myPoly);
+static void dPolynomial3DFree(psDPolynomial3D *myPoly);
+static void dPolynomial4DFree(psDPolynomial4D *myPoly);
+
 /*****************************************************************************/
 /*  FUNCTION IMPLEMENTATION - PUBLIC                                         */
@@ -108,4 +118,5 @@
 
     newPoly = (psPolynomial1D *) psAlloc(sizeof(psPolynomial1D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)polynomial1DFree);
     newPoly->n = n;
     newPoly->coeff    = (float *) psAlloc(n * sizeof(float));
@@ -128,4 +139,5 @@
 
     newPoly = (psPolynomial2D *) psAlloc(sizeof(psPolynomial2D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)polynomial2DFree);
     newPoly->nX = nX;
     newPoly->nY = nY;
@@ -158,4 +170,5 @@
 
     newPoly = (psPolynomial3D *) psAlloc(sizeof(psPolynomial3D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)polynomial3DFree);
     newPoly->nX = nX;
     newPoly->nY = nY;
@@ -197,4 +210,5 @@
 
     newPoly = (psPolynomial4D *) psAlloc(sizeof(psPolynomial4D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)polynomial4DFree);
     newPoly->nW = nW;
     newPoly->nX = nX;
@@ -235,13 +249,12 @@
 }
 
-void psPolynomial1DFree(psPolynomial1D *myPoly)
+static void polynomial1DFree(psPolynomial1D *myPoly)
 {
     psFree(myPoly->coeff);
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
-}
-
-void psPolynomial2DFree(psPolynomial2D *myPoly)
+}
+
+static void polynomial2DFree(psPolynomial2D *myPoly)
 {
     int x = 0;
@@ -255,9 +268,7 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-
-    psFree(myPoly);
-}
-
-void psPolynomial3DFree(psPolynomial3D *myPoly)
+}
+
+static void polynomial3DFree(psPolynomial3D *myPoly)
 {
     int x = 0;
@@ -278,8 +289,7 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
-}
-
-void psPolynomial4DFree(psPolynomial4D *myPoly)
+}
+
+static void polynomial4DFree(psPolynomial4D *myPoly)
 {
     int w = 0;
@@ -306,5 +316,4 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
 }
 
@@ -434,4 +443,5 @@
 
     newPoly = (psDPolynomial1D *) psAlloc(sizeof(psDPolynomial1D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)dPolynomial1DFree);
     newPoly->n = n;
     newPoly->coeff    = (double *) psAlloc(n * sizeof(double));
@@ -454,4 +464,5 @@
 
     newPoly = (psDPolynomial2D *) psAlloc(sizeof(psDPolynomial2D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)dPolynomial2DFree);
     newPoly->nX = nX;
     newPoly->nY = nY;
@@ -484,4 +495,5 @@
 
     newPoly = (psDPolynomial3D *) psAlloc(sizeof(psDPolynomial3D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)dPolynomial3DFree);
     newPoly->nX = nX;
     newPoly->nY = nY;
@@ -523,4 +535,5 @@
 
     newPoly = (psDPolynomial4D *) psAlloc(sizeof(psDPolynomial4D));
+    p_psMemSetDeallocator(newPoly,(psFreeFcn)dPolynomial4DFree);
     newPoly->nW = nW;
     newPoly->nX = nX;
@@ -561,13 +574,12 @@
 }
 
-void psDPolynomial1DFree(psDPolynomial1D *myPoly)
+static void dPolynomial1DFree(psDPolynomial1D *myPoly)
 {
     psFree(myPoly->coeff);
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
-}
-
-void psDPolynomial2DFree(psDPolynomial2D *myPoly)
+}
+
+static void dPolynomial2DFree(psDPolynomial2D *myPoly)
 {
     int x = 0;
@@ -581,9 +593,7 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-
-    psFree(myPoly);
-}
-
-void psDPolynomial3DFree(psDPolynomial3D *myPoly)
+}
+
+static void dPolynomial3DFree(psDPolynomial3D *myPoly)
 {
     int x = 0;
@@ -604,8 +614,7 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
-}
-
-void psDPolynomial4DFree(psDPolynomial4D *myPoly)
+}
+
+static void dPolynomial4DFree(psDPolynomial4D *myPoly)
 {
     int w = 0;
@@ -632,5 +641,4 @@
     psFree(myPoly->coeffErr);
     psFree(myPoly->mask);
-    psFree(myPoly);
 }
 
Index: /trunk/psLib/src/math/psSpline.h
===================================================================
--- /trunk/psLib/src/math/psSpline.h	(revision 1072)
+++ /trunk/psLib/src/math/psSpline.h	(revision 1073)
@@ -12,6 +12,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-14 19:32:42 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -104,19 +104,4 @@
                                    );
 
-/** Destructor */
-void psPolynomial1DFree(psPolynomial1D *myPoly ///< Polynomial to destroy
-                       );
-
-/** Destructor */
-void psPolynomial2DFree(psPolynomial2D *myPoly ///< Polynomial to destroy
-                       );
-/** Destructor */
-void psPolynomial3DFree(psPolynomial3D *myPoly ///< Polynomial to destroy
-                       );
-/** Destructor */
-void psPolynomial4DFree(psPolynomial4D *myPoly ///< Polynomial to destroy
-                       );
-
-
 /** Evaluate 1D polynomial */
 float
@@ -206,19 +191,4 @@
                                      );
 
-
-/** Destructor */
-void psDPolynomial1DFree(psDPolynomial1D *myPoly ///< Polynomial to destroy
-                        );
-/** Destructor */
-void psDPolynomial2DFree(psDPolynomial2D *myPoly ///< Polynomial to destroy
-                        );
-/** Destructor */
-void psDPolynomial3DFree(psDPolynomial3D *myPoly ///< Polynomial to destroy
-                        );
-/** Destructor */
-void psDPolynomial4DFree(psDPolynomial4D *myPoly ///< Polynomial to destroy
-                        );
-
-
 /** Evaluate 1D polynomial (double precision) */
 double
Index: /trunk/psLib/src/math/psStats.c
===================================================================
--- /trunk/psLib/src/math/psStats.c	(revision 1072)
+++ /trunk/psLib/src/math/psStats.c	(revision 1073)
@@ -32,4 +32,6 @@
                            psStats *stats);
 #endif
+
+static void histogramFree(psHistogram *myHist);
 
 /******************************************************************************
@@ -68,12 +70,4 @@
 
 /******************************************************************************
-    psStatsFree(): This routine must free the psStats data structure.
- *****************************************************************************/
-void psStatsFree(psStats *stats)
-{
-    psFree(stats);
-}
-
-/******************************************************************************
 psHistogramAlloc(lower, upper, n): allocate a uniform histogram structure
 with the specifed upper and lower limits, and the specifed number of bins.
@@ -108,4 +102,5 @@
     // bins, then there are N+1 bounds to those bins.
     newHist = (psHistogram *) psAlloc(sizeof(psHistogram));
+    p_psMemSetDeallocator(newHist,(psFreeFcn)histogramFree);
     newHist->bounds = psVectorAlloc(n+1, PS_TYPE_F32);
     newHist->bounds->n = newHist->bounds->nalloc;
@@ -160,4 +155,5 @@
     // Allocate memory for the new histogram structure.
     newHist = (psHistogram *) psAlloc(sizeof(psHistogram));
+    p_psMemSetDeallocator(newHist,(psFreeFcn)histogramFree);
     newHist->bounds = psVectorAlloc(bounds->n, PS_TYPE_F32);
     newHist->bounds->n = newHist->bounds->nalloc;
@@ -182,9 +178,8 @@
 }
 
-void psHistogramFree(psHistogram *myHist)
-{
-    psVectorFree(myHist->bounds);
-    psVectorFree(myHist->nums);
-    psFree(myHist);
+static void histogramFree(psHistogram *myHist)
+{
+    psFree(myHist->bounds);
+    psFree(myHist->nums);
 }
 
@@ -618,5 +613,5 @@
 
         // Free temporary data buffers.
-        psStatsFree(stats2);
+        psFree(stats2);
 
         // Set the PS_STAT_ROBUST_FOR_SAMPLE bit in the stats structure.
@@ -688,6 +683,6 @@
 
     // Free the temporary data structures.
-    psVectorFree(unsortedVector);
-    psVectorFree(sortedVector);
+    psFree(unsortedVector);
+    psFree(sortedVector);
 }
 
@@ -775,5 +770,5 @@
 
         // Free temporary data buffers.
-        psStatsFree(stats2);
+        psFree(stats2);
 
         // Set the PS_STAT_ROBUST_FOR_SAMPLE bit in the stats structure.
@@ -840,6 +835,6 @@
 
     // Free the temporary data structures.
-    psVectorFree(unsortedVector);
-    psVectorFree(sortedVector);
+    psFree(unsortedVector);
+    psFree(sortedVector);
     // NOTE: This is the
 }
@@ -1043,5 +1038,5 @@
     }
 
-    psVectorFree(tmpMask);
+    psFree(tmpMask);
 }
 
@@ -1125,6 +1120,6 @@
             stats->robustLQ = stats->clippedMean;
         }
-        psStatsFree(tmpStats);
-        psHistogramFree(robustHistogram);
+        psFree(tmpStats);
+        psFree(robustHistogram);
         return;
     }
@@ -1200,6 +1195,6 @@
     stats->robustNfit = 0.0;
     stats->robustN50 = 0.0;
-    psStatsFree(tmpStats);
-    psHistogramFree(robustHistogram);
+    psFree(tmpStats);
+    psFree(robustHistogram);
 }
 
Index: /trunk/psLib/src/math/psStats.h
===================================================================
--- /trunk/psLib/src/math/psStats.h	(revision 1072)
+++ /trunk/psLib/src/math/psStats.h	(revision 1073)
@@ -9,6 +9,6 @@
  *  @author George Gusciora, MHPCC
  *
- *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-14 19:33:09 $
+ *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -88,7 +88,4 @@
 psStats *psStatsAlloc(psStatsOptions options); ///< Statistics to measure
 
-/** A destructor for the stats structure.*/
-void psStatsFree(psStats *restrict stats); ///< Stats structure to destroy
-
 /******************************************************************************
     Histogram functions and data structures.
@@ -116,9 +113,4 @@
 psHistogram * psHistogramAllocGeneric(const psVector *restrict bounds); ///< Bounds for the bins
 
-
-/** Destructor \ingroup MathGroup **/
-void psHistogramFree(psHistogram *myHist);          ///< Histogram to destroy
-
-
 /** Calculate a histogram \ingroup MathGroup **/
 psHistogram *psHistogramVector (psHistogram *out,   ///< Histogram data
Index: /trunk/psLib/src/mathtypes/psImage.c
===================================================================
--- /trunk/psLib/src/mathtypes/psImage.c	(revision 1072)
+++ /trunk/psLib/src/mathtypes/psImage.c	(revision 1073)
@@ -9,6 +9,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-11 02:02:53 $
+ *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -28,4 +28,5 @@
 #include "psImage.h"
 
+static void imageFree(psImage* image);
 
 /*****************************************************************************/
@@ -49,4 +50,5 @@
 
     psImage *image = (psImage *)psAlloc(sizeof(psImage));
+    p_psMemSetDeallocator(image,(psFreeFcn)imageFree);
 
     image->data.V = psAlloc(sizeof(void*)*numRows);
@@ -71,5 +73,5 @@
 }
 
-void psImageFree(psImage *image)
+static void imageFree(psImage* image)
 {
     if (image == NULL) {
@@ -96,6 +98,4 @@
     psFree(image->data.V);
     image->data.V = NULL;
-
-    psFree(image);
 }
 
@@ -237,5 +237,5 @@
         if (children[i] != NULL) {
             numFreed++;
-            psImageFree(children[i]);
+            psFree(children[i]);
         }
     }
@@ -341,5 +341,5 @@
     case PS_TYPE_PTR: \
         psError(__func__,"Can't copy image from a matrix of pointers."); \
-        psImageFree(output); \
+        psFree(output); \
         return NULL; \
     default: \
@@ -391,5 +391,5 @@
     case PS_TYPE_PTR:
         psError(__func__,"Can't copy image into a matrix of pointers.");
-        psImageFree(output);
+        psFree(output);
         return NULL;
     }
@@ -534,5 +534,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -676,5 +676,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -818,5 +818,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -960,5 +960,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -1102,5 +1102,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -1244,5 +1244,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -1386,5 +1386,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -1528,5 +1528,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -1670,5 +1670,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -1812,5 +1812,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -1954,5 +1954,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -2096,5 +2096,5 @@
         case PS_TYPE_PTR:
             psError (__func__, "Can't copy image from a matrix of pointers.");
-            psImageFree (output);
+            psFree (output);
             return ((void *) 0);
         default:
@@ -2104,5 +2104,5 @@
     case PS_TYPE_PTR:
         psError (__func__, "Can't copy image into a matrix of pointers.");
-        psImageFree (output);
+        psFree (output);
         return ((void *) 0);
     }
Index: /trunk/psLib/src/mathtypes/psImage.h
===================================================================
--- /trunk/psLib/src/mathtypes/psImage.h	(revision 1072)
+++ /trunk/psLib/src/mathtypes/psImage.h	(revision 1073)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-10 01:58:06 $
+ *  @version $Revision: 1.22 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -110,14 +110,4 @@
 );
 
-/** Destroy the specified image.
- *
- *  Uses psLib memory deallocation functions to free an image and any existing
- *  children.
- *
- */
-void psImageFree(
-    psImage *restrict image             ///< Free psImage
-);
-
 /** Frees all children of a psImage.
  *
Index: /trunk/psLib/src/mathtypes/psVector.c
===================================================================
--- /trunk/psLib/src/mathtypes/psVector.c	(revision 1072)
+++ /trunk/psLib/src/mathtypes/psVector.c	(revision 1073)
@@ -8,6 +8,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-12 01:33:16 $
+ *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -49,4 +49,5 @@
 /*  FUNCTION IMPLEMENTATION - LOCAL                                          */
 /*****************************************************************************/
+static void vectorFree(psVector *restrict psVec);
 
 /*****************************************************************************/
@@ -68,4 +69,5 @@
     // Create vector struct
     psVec = (psVector *)psAlloc(sizeof(psVector));
+    p_psMemSetDeallocator(psVec,(psFreeFcn)vectorFree);
 
     psVec->type.dimen = PS_DIMEN_VECTOR;
@@ -132,5 +134,5 @@
     if(nalloc < 1) {
         psError(__func__, "Invalid value for nalloc (%d)\n", nalloc);
-        psVectorFree(in);
+        psFree(in);
         return NULL;
     }
@@ -154,5 +156,5 @@
 }
 
-void psVectorFree(psVector *restrict psVec)
+static void vectorFree(psVector *restrict psVec)
 {
     if (psVec == NULL) {
@@ -160,9 +162,15 @@
     }
 
+    if (psVec->type.type == PS_TYPE_PTR) {
+        for(int i = 0; i < psVec->n; i++) {
+            psFree(psVec->data.PTR[i]);
+            psVec->data.PTR[i] = NULL;
+        }
+    }
+
     psFree(psVec->data.V);
-    psFree(psVec);
 }
 
-void psVectorElementFree(psVector *restrict psVec, void (*elemFree)(void *))
+void psVectorElementFree(psVector *restrict psVec)
 {
 
@@ -176,10 +184,6 @@
     }
 
-    for(int i = 0; i < psVec->nalloc; i++) {
-        if(elemFree == NULL) {
-            psMemDecrRefCounter(psVec->data.PTR[i]);
-        } else {
-            elemFree(psMemDecrRefCounter(psVec->data.PTR[i]));
-        }
+    for(int i = 0; i < psVec->n; i++) {
+        psFree(psVec->data.PTR[i]);
         psVec->data.PTR[i] = NULL;
     }
Index: /trunk/psLib/src/mathtypes/psVector.h
===================================================================
--- /trunk/psLib/src/mathtypes/psVector.h	(revision 1072)
+++ /trunk/psLib/src/mathtypes/psVector.h	(revision 1073)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-10 01:58:06 $
+ *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -100,17 +100,4 @@
 );
 
-/** Deallocate a vector.
- *
- * Uses psLib memory allocation functions to deallocate a vector collection of data. The vector is deallocated
- * according to the psType type member contained within the vector.
- *
- * @return psVector*: Pointer to psVector.
- *
- */
-void psVectorFree(
-    psVector *restrict psVec  ///< Vector to free.
-);
-
-
 /** Deallocate/Dereference elements of a void pointer vector.
  *
@@ -122,6 +109,5 @@
  */
 void psVectorElementFree(
-    psVector *restrict psVec,   ///< Void pointer vector to destroy.
-    void (*elemFree)(void *)    ///< Optional callback function to remove vector elements.
+    psVector *restrict psVec    ///< Void pointer vector to destroy.
 );
 
Index: /trunk/psLib/src/sys/psMemory.c
===================================================================
--- /trunk/psLib/src/sys/psMemory.c	(revision 1072)
+++ /trunk/psLib/src/sys/psMemory.c	(revision 1073)
@@ -8,6 +8,6 @@
  *  @author Robert Lupton, Princeton University
  *
- *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-04 23:46:48 $
+ *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -30,6 +30,6 @@
 static int checkMemBlock(const psMemBlock *m, const char* funcName);
 static psMemBlock *lastMemBlockAllocated = NULL;
-pthread_mutex_t   memBlockListMutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t   memIdMutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t memBlockListMutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t memIdMutex = PTHREAD_MUTEX_INITIALIZER;
 
 /**
@@ -96,5 +96,5 @@
 psMemoryId p_psMemFreeID = 0;   // notify user this block is freed
 
-psMemoryId psMemAllocateCallbackSetID(psMemoryId id) // set p_psMemAllocateID to id
+psMemoryId psMemAllocateCallbackSetID(psMemoryId id)
 {
     psMemoryId old = p_psMemAllocateID;
@@ -104,5 +104,5 @@
 }
 
-psMemoryId psMemFreeCallbackSetID(psMemoryId id)  // set p_psMemFreeID to id
+psMemoryId psMemFreeCallbackSetID(psMemoryId id)
 {
     psMemoryId old = p_psMemFreeID;
@@ -184,7 +184,5 @@
 #define ALIGNED(P) ((void *)((long)(P) & ~03) == (P))
 
-static int
-checkMemBlock(const psMemBlock *m,
-              const char* funcName)
+static int checkMemBlock(const psMemBlock *m, const char* funcName)
 {
     // n.b. since this is called by psMemCheckCorruption while the memblock list is mutex locked,
@@ -260,4 +258,5 @@
 
     ptr->file = file;
+    ptr->freeFcn = NULL;
     *(unsigned int*)&ptr->lineno = lineno;
     ptr->startblock = P_PS_MEMMAGIC;
@@ -346,7 +345,8 @@
     if (checkMemBlock(ptr, __func__) != 0) {
         memProblemCallback(ptr, file, lineno); // we may not own this block; don't free it
-    }
-
-    psMemDecrRefCounter(vptr);          // this handles the free, if required.
+        return;
+    }
+
+    (void)psMemDecrRefCounter(vptr);   // this handles the free, if required.
 }
 
@@ -354,8 +354,5 @@
  * Check for memory leaks. Not production quality code
  */
-int psMemCheckLeaks(
-    psMemoryId id0,                     // don't list blocks with id < id0
-    psMemBlock ***arr,                  // pointer to array of pointers to leaked blocks, or NULL
-    FILE *fd)                           // print list of leaks to fd (or NULL)
+int psMemCheckLeaks(psMemoryId id0,psMemBlock ***arr,FILE *fd)
 {
     int nleak = 0;
@@ -365,6 +362,5 @@
     pthread_mutex_lock(&memBlockListMutex);
 
-    for (psMemBlock* iter = topBlock; iter != NULL; iter=iter->nextBlock)
-    {
+    for (psMemBlock* iter = topBlock; iter != NULL; iter=iter->nextBlock) {
         if ( (psMemGetRefCounter(iter+1) > 0) && (iter->id >= id0) ) {
             nleak++;
@@ -382,6 +378,5 @@
     pthread_mutex_unlock(&memBlockListMutex);
 
-    if (nleak == 0 || arr == NULL)
-    {
+    if (nleak == 0 || arr == NULL) {
         return nleak;
     }
@@ -390,6 +385,5 @@
     pthread_mutex_lock(&memBlockListMutex);
 
-    for (psMemBlock* iter = topBlock; iter != NULL; iter=iter->nextBlock)
-    {
+    for (psMemBlock* iter = topBlock; iter != NULL; iter=iter->nextBlock) {
         if ( (psMemGetRefCounter(iter+1) > 0) && (iter->id >= id0) ) {
             (*arr)[j++] = iter;
@@ -408,11 +402,11 @@
  * Reference counting APIs
  */
-psReferenceCount psMemGetRefCounter(void *vptr) // return refCounter
+// return refCounter
+psReferenceCount psMemGetRefCounter(void *vptr)
 {
     psMemBlock *ptr;
     unsigned int refCount;
 
-    if (vptr == NULL)
-    {
+    if (vptr == NULL) {
         return 0;
     }
@@ -420,6 +414,5 @@
     ptr = ((psMemBlock *)vptr) - 1;
 
-    if (checkMemBlock(ptr, __func__) != 0)
-    {
+    if (checkMemBlock(ptr, __func__) != 0) {
         memProblemCallback(ptr, __func__, __LINE__);
     }
@@ -431,11 +424,10 @@
     return refCount;
 }
-
-void *psMemIncrRefCounter(void *vptr) // increment and return refCounter
+// increment and return refCounter
+void *psMemIncrRefCounter(void *vptr)
 {
     psMemBlock *ptr;
 
-    if (vptr == NULL)
-    {
+    if (vptr == NULL) {
         return vptr;
     }
@@ -443,6 +435,5 @@
     ptr = ((psMemBlock *)vptr) - 1;
 
-    if (checkMemBlock(ptr, __func__))
-    {
+    if (checkMemBlock(ptr, __func__)) {
         memProblemCallback(ptr, __func__, __LINE__);
     }
@@ -455,8 +446,8 @@
 }
 
-void *psMemDecrRefCounter(void *vptr) // decrement and return refCounter
-{
-    if (vptr == NULL)
-    {
+// decrement and return refCounter
+void *psMemDecrRefCounter(void *vptr)
+{
+    if (vptr == NULL) {
         return NULL;
     }
@@ -467,12 +458,10 @@
     pthread_mutex_lock(&ptr->refCounterMutex);
 
-    if (ptr->refCounter > 1)
-    {
+    if (ptr->refCounter > 1) {
         /// XXX - Probably should have another mutex here.
         ptr->refCounter--;          // multiple references, just decrement the count.
         pthread_mutex_unlock(&ptr->refCounterMutex);
 
-    } else
-    {
+    } else {
         pthread_mutex_unlock(&ptr->refCounterMutex);
 
@@ -482,4 +471,8 @@
         }
 
+        if (ptr->freeFcn != NULL) {
+            ptr->freeFcn(vptr);
+        }
+
         pthread_mutex_lock(&memBlockListMutex);
 
@@ -507,15 +500,23 @@
 }
 
-void p_psCustomFree(psFreeFcn fcn, void* ptr)
-{
-
-    if (fcn == NULL) {
+void p_psMemSetDeallocator(void* vptr, psFreeFcn freeFcn)
+{
+    if (vptr == NULL) {
         return;
-    } else {
-        if (fcn == PS_FREE) {
-            psFree(ptr);
-        } else {
-            fcn(ptr);
-        }
-    }
-}
+    }
+
+    psMemBlock *ptr = ((psMemBlock *)vptr) - 1;
+
+    ptr->freeFcn = freeFcn;
+
+}
+psFreeFcn p_psMemGetDeallocator(void* vptr)
+{
+    if (vptr == NULL) {
+        return NULL;
+    }
+
+    psMemBlock *ptr = ((psMemBlock *)vptr) - 1;
+
+    return ptr->freeFcn;
+}
Index: /trunk/psLib/src/sys/psMemory.h
===================================================================
--- /trunk/psLib/src/sys/psMemory.h	(revision 1072)
+++ /trunk/psLib/src/sys/psMemory.h	(revision 1073)
@@ -14,6 +14,6 @@
  *  @ingroup MemoryManagement
  *
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-10 02:09:57 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -50,4 +50,7 @@
 /// typedef for a memory block's reference count. Guaranteed to be some variety of integer.
 typedef unsigned long psReferenceCount;
+
+/// typedef for deallocator.
+typedef void (*psFreeFcn)(void* ptr);
 
 /** Book-keeping data for storage allocator.
@@ -58,14 +61,15 @@
 typedef struct psMemBlock
 {
-    const void* startblock;             ///< initialised to p_psMEMMAGIC
-    struct psMemBlock* previousBlock;   ///< previous block in allocation list
-    struct psMemBlock* nextBlock;       ///< next block allocation list
-    size_t  userMemorySize;             ///< the size of the user-portion of the memory block
-    const psMemoryId id;                ///< a unique ID for this allocation
-    const char* file;                   ///< set from __FILE__ in e.g. p_psAlloc
-    const int lineno;                   ///< set from __LINE__ in e.g. p_psAlloc
-    pthread_mutex_t   refCounterMutex;  ///< mutex to ensure exclusive access to reference counter
-    psReferenceCount refCounter;        ///< how many times pointer is referenced
-    const void* endblock;               ///< initialised to p_psMEMMAGIC
+    const void* startblock;            ///< initialised to p_psMEMMAGIC
+    struct psMemBlock* previousBlock;  ///< previous block in allocation list
+    struct psMemBlock* nextBlock;      ///< next block allocation list
+    psFreeFcn freeFcn;                 ///< deallocator.  If NULL, use generic deallocation.
+    size_t  userMemorySize;            ///< the size of the user-portion of the memory block
+    const psMemoryId id;               ///< a unique ID for this allocation
+    const char* file;                  ///< set from __FILE__ in e.g. p_psAlloc
+    const int lineno;                  ///< set from __LINE__ in e.g. p_psAlloc
+    pthread_mutex_t   refCounterMutex; ///< mutex to ensure exclusive access to reference counter
+    psReferenceCount refCounter;       ///< how many times pointer is referenced
+    const void* endblock;              ///< initialised to p_psMEMMAGIC
 }
 psMemBlock;
@@ -114,10 +118,8 @@
 );
 
-typedef void (*psFreeFcn)(void* ptr);
-
 /** Memory allocation.  This operates much like malloc(), but is guaranteed to return a non-NULL value.
  *
  *  @return void* pointer to the allocated buffer. This will not be NULL.
- *  @see psFree
+ *  @see psFree 
  */
 #ifdef DOXYGEN
@@ -131,4 +133,8 @@
     int lineno                      ///< Line number of call
 );
+
+void p_psMemSetDeallocator(void* ptr, psFreeFcn freeFcn);
+psFreeFcn p_psMemGetDeallocator(void* ptr);
+
 /// Memory allocation. psAlloc sends file and line number to p_psAlloc.
 #define psAlloc(size) p_psAlloc(size, __FILE__, __LINE__)
@@ -282,12 +288,7 @@
 );
 
-#define PS_FREE     (void*)1
-
 //@} End of Memory Management Functions
 
-
 #ifndef DOXYGEN
-
-void p_psCustomFree(psFreeFcn fcn,void* ptr);
 
 /*
Index: /trunk/psLib/src/sysUtils/psHash.c
===================================================================
--- /trunk/psLib/src/sysUtils/psHash.c	(revision 1072)
+++ /trunk/psLib/src/sysUtils/psHash.c	(revision 1073)
@@ -10,6 +10,6 @@
  *  @author George Gusciora, MHPCC
  *   
- *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-10 00:09:55 $
+ *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -18,4 +18,5 @@
 #include <stdio.h>
 #include <string.h>
+#include <stdbool.h>
 #include "psHash.h"
 #include "psMemory.h"
@@ -24,4 +25,9 @@
 #include "psAbort.h"
 
+static psHashBucket *hashBucketAlloc(const char *key,void *data,psHashBucket *next);
+static void hashBucketFree(psHashBucket *bucket);
+static void *doHashWork(psHash* table, const char* key, void* data, bool remove
+                           );
+static void hashFree(psHash *table);
 
 /******************************************************************************
@@ -87,4 +93,5 @@
     // Allocate memory for the new hash bucket.
     psHashBucket *bucket = psAlloc(sizeof(psHashBucket));
+    p_psMemSetDeallocator(bucket,(psFreeFcn)hashBucketFree);
 
     // Initialize the bucket.
@@ -105,20 +112,14 @@
 
 /******************************************************************************
-hashBucketFree(bucket, itemFree): This procedure deallocates the specified
-hash bucket.  If "itemFree" is NULL, then we simply free the data with the
-standard psFree() function.  If "itemFree" is not NULL, then it must be a
-function pointer which takes the hash bucket as a parameter, and frees the
-data in that hash bucket.
+hashBucketFree(bucket): This procedure deallocates the specified
+hash bucket.  
 Inputs:
     bucket: the hash bucket to be freed.
-    itemFree: a function pointer, possibly NULL.
 Return:
     NONE
  *****************************************************************************/
-static void hashBucketFree(psHashBucket *bucket,   // bucket to free
-                           void (*itemFree)(void *item)) // how to free data;
-{
-    if (bucket == NULL)
-    {
+static void hashBucketFree(psHashBucket *bucket)
+{
+    if (bucket == NULL) {
         return;
     }
@@ -126,21 +127,9 @@
     // A bucket is actually a linked list of buckets.  We recursively step
     // through that linked list, free each bucket.
-    if (bucket->next != NULL)
-    {
-        hashBucketFree(bucket, itemFree);
-    }
+    psFree(bucket->next);
 
     psFree(bucket->key);
-    psMemDecrRefCounter(bucket->data);
-
-    if (itemFree != NULL)
-    {
-        itemFree(bucket->data);
-    } else
-    {
-        psFree(bucket->data);
-    }
-
-    psFree(bucket);
+
+    psFree(bucket->data);
 }
 
@@ -159,4 +148,5 @@
     // Create the new hash table.
     psHash *table = psAlloc(sizeof(psHash));
+    p_psMemSetDeallocator(table,(psFreeFcn)hashFree);
 
     // Allocate memory for the buckets.
@@ -185,10 +175,8 @@
 Inputs:
     table: a hash table
-    itemFree: a function pointer, possibly NULL.
 Return:
     NONE
  *****************************************************************************/
-void psHashFree(psHash *table,  // hash table to be freed
-                void (*itemFree)(void *item)) // how to free hashed data; or NULL
+static void hashFree(psHash *table)
 {
     psHashBucket *tmp = NULL;           // Used to step through linked list.
@@ -196,6 +184,5 @@
     int i = 0;                          // Loop index variable.
 
-    if (table == NULL)
-    {
+    if (table == NULL) {
         return;
     }
@@ -204,6 +191,5 @@
     // NULL, then free the bucket via a function call to hashBucketFree();
 
-    for (i = 0; i < table->nbucket; i++)
-    {
+    for (i = 0; i < table->nbucket; i++) {
         // A bucket is composed of a linked list of buckets.  We use the
         // "tmp" and "ptr" pointers to step through that list and free each
@@ -214,5 +200,5 @@
             while (ptr != NULL) {
                 tmp = ptr->next;
-                hashBucketFree(ptr, itemFree);
+                psFree(ptr);
                 ptr = tmp;
             }
@@ -222,15 +208,13 @@
     // Free the bucket structure, then the hash table.
     psFree(table->buckets);
-    psFree(table);
-}
-
-/******************************************************************************
-doHashWork(table, key, data, remove, itemFree): This is an internal
+}
+
+/******************************************************************************
+doHashWork(table, key, data, remove): This is an internal
 procedure which does the bulk of the work in using the hash table.  Depending
 upon the input parameters, it will either insert a new key/data into the hash
 table, retrieve the data for a specified key, or remove a key/data item.  If
-we try to insert a key that already exists in the hash table, then we call
-the user-supplied function itemfree (or psFree if that is NULL), to free the
-existing data/key item.
+we try to insert a key that already exists in the hash table, then we deallocate
+the existing data/key item.
 Inputs:
     table: a hash table
@@ -238,5 +222,4 @@
     data: the data to insert, if not NULL
     remove: set to non-zero if the key/data should be removed from the table.
-    itemFree: function pointer
 Return:
     NONE
@@ -246,10 +229,6 @@
 there is little common code between those functions.
   *****************************************************************************/
-static void *doHashWork(psHash     *table,   // table to insert in
-                        const char *key,     // key to use
-                        void       *data,    // data to insert, or (if NULL) retrieve/remove
-                        int remove
-                            ,          // remove the item from the list?
-                            void (*itemFree)(void *item)) // how to free hashed data
+static void *doHashWork(psHash *table, const char *key, void *data, bool remove
+                           )
 {
     long int hash = 1;                  // This will contain an integer value
@@ -313,10 +292,9 @@
                     }
 
-                    psFree(ptr->key);
                     psFree(ptr);
 
                     // By definition, the data associated with that key
                     // must be returned, not freed.
-                    return psMemDecrRefCounter(data);
+                    return data;
                 }
                 optr = ptr;
@@ -354,9 +332,5 @@
                 // the new data was not inserted into the hash table.
 
-                if (itemFree == NULL) {
-                    psFree(psMemDecrRefCounter(ptr->data));
-                } else {
-                    itemFree(psMemDecrRefCounter(ptr->data));
-                }
+                psFree(ptr->data);
 
                 ptr->data = psMemIncrRefCounter(data);
@@ -385,8 +359,5 @@
     NONE
  *****************************************************************************/
-void *psHashInsert(psHash *table,   // table to insert in
-                   const char *key, // key to use
-                   void *data,      // data to insert
-                   void (*itemFree)(void *item)) // how to free hashed data;
+void *psHashInsert(psHash *table, const char *key, void *data)
 {
     if (table == NULL) {
@@ -400,5 +371,5 @@
     }
 
-    return doHashWork(table, key, data, 0, itemFree);
+    return doHashWork(table, key, data, 0);
 }
 
@@ -425,5 +396,5 @@
 
 
-    return doHashWork(table, key, NULL, 0, NULL);
+    return doHashWork(table, key, NULL, 0);
 }
 
@@ -438,7 +409,5 @@
     The data that was associated with that key.
  *****************************************************************************/
-void *psHashRemove(psHash *table,   // table to lookup key in
-                   const char *key, // key to lookup
-                   void (*itemFree)(void *item)) // how to free hashed data;
+void *psHashRemove(psHash *table, const char *key)
 {
     if (table == NULL) {
@@ -449,4 +418,4 @@
     }
 
-    return doHashWork(table, key, NULL, 1, itemFree);
-}
+    return doHashWork(table, key, NULL, 1);
+}
Index: /trunk/psLib/src/sysUtils/psHash.d
===================================================================
--- /trunk/psLib/src/sysUtils/psHash.d	(revision 1072)
+++ /trunk/psLib/src/sysUtils/psHash.d	(revision 1073)
@@ -1,3 +1,3 @@
 psHash.o psHash.d : psHash.c psHash.h ../collections/psList.h \
-  ../collections/psVector.h ../collections/psType.h \
-  ../sysUtils/psMemory.h psString.h psTrace.h psAbort.h
+  ../collections/psVector.h ../collections/psType.h psMemory.h psString.h \
+  psTrace.h psAbort.h
Index: /trunk/psLib/src/sysUtils/psHash.h
===================================================================
--- /trunk/psLib/src/sysUtils/psHash.h	(revision 1072)
+++ /trunk/psLib/src/sysUtils/psHash.h	(revision 1073)
@@ -10,6 +10,6 @@
  *  @author George Gusciora, MHPCC
  *   
- *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-12 05:50:01 $
+ *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -45,25 +45,18 @@
                    );
 
-/// Free hash buckets from table.
-void psHashFree(psHash *table,               ///< hash table to be freed
-                void (*itemFree)(void *item) ///< how to free hashed data; or NULL
-               );
-
 /// Insert entry into table.
 void *psHashInsert(psHash *table,               ///< table to insert in
                    const char *key,             ///< key to use
-                   void *data,                  ///< data to insert
-                   void (*itemFree)(void *item) ///< how to free hashed data; or NULL
+                   void *data                   ///< data to insert
                   );
 
 /// Lookup key in table.
-void *psHashLookup(psHash *table, ///< table to lookup key in
-                   const char *key ///< key to lookup
+void *psHashLookup(psHash *table,      ///< table to lookup key in
+                   const char *key     ///< key to lookup
                   );
 
 /// Remove key from table.
-void *psHashRemove(psHash *table, ///< table to lookup key in
-                   const char *key, ///< key to lookup
-                   void (*itemFree)(void *item) ///< how to free hashed data; or NULL
+void *psHashRemove(psHash *table,      ///< table to lookup key in
+                   const char *key     ///< key to lookup
                   );
 
Index: /trunk/psLib/src/sysUtils/psMemory.c
===================================================================
--- /trunk/psLib/src/sysUtils/psMemory.c	(revision 1072)
+++ /trunk/psLib/src/sysUtils/psMemory.c	(revision 1073)
@@ -8,6 +8,6 @@
  *  @author Robert Lupton, Princeton University
  *
- *  @version $Revision: 1.24 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-04 23:46:48 $
+ *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -30,6 +30,6 @@
 static int checkMemBlock(const psMemBlock *m, const char* funcName);
 static psMemBlock *lastMemBlockAllocated = NULL;
-pthread_mutex_t   memBlockListMutex = PTHREAD_MUTEX_INITIALIZER;
-pthread_mutex_t   memIdMutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t memBlockListMutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t memIdMutex = PTHREAD_MUTEX_INITIALIZER;
 
 /**
@@ -96,5 +96,5 @@
 psMemoryId p_psMemFreeID = 0;   // notify user this block is freed
 
-psMemoryId psMemAllocateCallbackSetID(psMemoryId id) // set p_psMemAllocateID to id
+psMemoryId psMemAllocateCallbackSetID(psMemoryId id)
 {
     psMemoryId old = p_psMemAllocateID;
@@ -104,5 +104,5 @@
 }
 
-psMemoryId psMemFreeCallbackSetID(psMemoryId id)  // set p_psMemFreeID to id
+psMemoryId psMemFreeCallbackSetID(psMemoryId id)
 {
     psMemoryId old = p_psMemFreeID;
@@ -184,7 +184,5 @@
 #define ALIGNED(P) ((void *)((long)(P) & ~03) == (P))
 
-static int
-checkMemBlock(const psMemBlock *m,
-              const char* funcName)
+static int checkMemBlock(const psMemBlock *m, const char* funcName)
 {
     // n.b. since this is called by psMemCheckCorruption while the memblock list is mutex locked,
@@ -260,4 +258,5 @@
 
     ptr->file = file;
+    ptr->freeFcn = NULL;
     *(unsigned int*)&ptr->lineno = lineno;
     ptr->startblock = P_PS_MEMMAGIC;
@@ -346,7 +345,8 @@
     if (checkMemBlock(ptr, __func__) != 0) {
         memProblemCallback(ptr, file, lineno); // we may not own this block; don't free it
-    }
-
-    psMemDecrRefCounter(vptr);          // this handles the free, if required.
+        return;
+    }
+
+    (void)psMemDecrRefCounter(vptr);   // this handles the free, if required.
 }
 
@@ -354,8 +354,5 @@
  * Check for memory leaks. Not production quality code
  */
-int psMemCheckLeaks(
-    psMemoryId id0,                     // don't list blocks with id < id0
-    psMemBlock ***arr,                  // pointer to array of pointers to leaked blocks, or NULL
-    FILE *fd)                           // print list of leaks to fd (or NULL)
+int psMemCheckLeaks(psMemoryId id0,psMemBlock ***arr,FILE *fd)
 {
     int nleak = 0;
@@ -365,6 +362,5 @@
     pthread_mutex_lock(&memBlockListMutex);
 
-    for (psMemBlock* iter = topBlock; iter != NULL; iter=iter->nextBlock)
-    {
+    for (psMemBlock* iter = topBlock; iter != NULL; iter=iter->nextBlock) {
         if ( (psMemGetRefCounter(iter+1) > 0) && (iter->id >= id0) ) {
             nleak++;
@@ -382,6 +378,5 @@
     pthread_mutex_unlock(&memBlockListMutex);
 
-    if (nleak == 0 || arr == NULL)
-    {
+    if (nleak == 0 || arr == NULL) {
         return nleak;
     }
@@ -390,6 +385,5 @@
     pthread_mutex_lock(&memBlockListMutex);
 
-    for (psMemBlock* iter = topBlock; iter != NULL; iter=iter->nextBlock)
-    {
+    for (psMemBlock* iter = topBlock; iter != NULL; iter=iter->nextBlock) {
         if ( (psMemGetRefCounter(iter+1) > 0) && (iter->id >= id0) ) {
             (*arr)[j++] = iter;
@@ -408,11 +402,11 @@
  * Reference counting APIs
  */
-psReferenceCount psMemGetRefCounter(void *vptr) // return refCounter
+// return refCounter
+psReferenceCount psMemGetRefCounter(void *vptr)
 {
     psMemBlock *ptr;
     unsigned int refCount;
 
-    if (vptr == NULL)
-    {
+    if (vptr == NULL) {
         return 0;
     }
@@ -420,6 +414,5 @@
     ptr = ((psMemBlock *)vptr) - 1;
 
-    if (checkMemBlock(ptr, __func__) != 0)
-    {
+    if (checkMemBlock(ptr, __func__) != 0) {
         memProblemCallback(ptr, __func__, __LINE__);
     }
@@ -431,11 +424,10 @@
     return refCount;
 }
-
-void *psMemIncrRefCounter(void *vptr) // increment and return refCounter
+// increment and return refCounter
+void *psMemIncrRefCounter(void *vptr)
 {
     psMemBlock *ptr;
 
-    if (vptr == NULL)
-    {
+    if (vptr == NULL) {
         return vptr;
     }
@@ -443,6 +435,5 @@
     ptr = ((psMemBlock *)vptr) - 1;
 
-    if (checkMemBlock(ptr, __func__))
-    {
+    if (checkMemBlock(ptr, __func__)) {
         memProblemCallback(ptr, __func__, __LINE__);
     }
@@ -455,8 +446,8 @@
 }
 
-void *psMemDecrRefCounter(void *vptr) // decrement and return refCounter
-{
-    if (vptr == NULL)
-    {
+// decrement and return refCounter
+void *psMemDecrRefCounter(void *vptr)
+{
+    if (vptr == NULL) {
         return NULL;
     }
@@ -467,12 +458,10 @@
     pthread_mutex_lock(&ptr->refCounterMutex);
 
-    if (ptr->refCounter > 1)
-    {
+    if (ptr->refCounter > 1) {
         /// XXX - Probably should have another mutex here.
         ptr->refCounter--;          // multiple references, just decrement the count.
         pthread_mutex_unlock(&ptr->refCounterMutex);
 
-    } else
-    {
+    } else {
         pthread_mutex_unlock(&ptr->refCounterMutex);
 
@@ -482,4 +471,8 @@
         }
 
+        if (ptr->freeFcn != NULL) {
+            ptr->freeFcn(vptr);
+        }
+
         pthread_mutex_lock(&memBlockListMutex);
 
@@ -507,15 +500,23 @@
 }
 
-void p_psCustomFree(psFreeFcn fcn, void* ptr)
-{
-
-    if (fcn == NULL) {
+void p_psMemSetDeallocator(void* vptr, psFreeFcn freeFcn)
+{
+    if (vptr == NULL) {
         return;
-    } else {
-        if (fcn == PS_FREE) {
-            psFree(ptr);
-        } else {
-            fcn(ptr);
-        }
-    }
-}
+    }
+
+    psMemBlock *ptr = ((psMemBlock *)vptr) - 1;
+
+    ptr->freeFcn = freeFcn;
+
+}
+psFreeFcn p_psMemGetDeallocator(void* vptr)
+{
+    if (vptr == NULL) {
+        return NULL;
+    }
+
+    psMemBlock *ptr = ((psMemBlock *)vptr) - 1;
+
+    return ptr->freeFcn;
+}
Index: /trunk/psLib/src/sysUtils/psMemory.h
===================================================================
--- /trunk/psLib/src/sysUtils/psMemory.h	(revision 1072)
+++ /trunk/psLib/src/sysUtils/psMemory.h	(revision 1073)
@@ -14,6 +14,6 @@
  *  @ingroup MemoryManagement
  *
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-10 02:09:57 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -50,4 +50,7 @@
 /// typedef for a memory block's reference count. Guaranteed to be some variety of integer.
 typedef unsigned long psReferenceCount;
+
+/// typedef for deallocator.
+typedef void (*psFreeFcn)(void* ptr);
 
 /** Book-keeping data for storage allocator.
@@ -58,14 +61,15 @@
 typedef struct psMemBlock
 {
-    const void* startblock;             ///< initialised to p_psMEMMAGIC
-    struct psMemBlock* previousBlock;   ///< previous block in allocation list
-    struct psMemBlock* nextBlock;       ///< next block allocation list
-    size_t  userMemorySize;             ///< the size of the user-portion of the memory block
-    const psMemoryId id;                ///< a unique ID for this allocation
-    const char* file;                   ///< set from __FILE__ in e.g. p_psAlloc
-    const int lineno;                   ///< set from __LINE__ in e.g. p_psAlloc
-    pthread_mutex_t   refCounterMutex;  ///< mutex to ensure exclusive access to reference counter
-    psReferenceCount refCounter;        ///< how many times pointer is referenced
-    const void* endblock;               ///< initialised to p_psMEMMAGIC
+    const void* startblock;            ///< initialised to p_psMEMMAGIC
+    struct psMemBlock* previousBlock;  ///< previous block in allocation list
+    struct psMemBlock* nextBlock;      ///< next block allocation list
+    psFreeFcn freeFcn;                 ///< deallocator.  If NULL, use generic deallocation.
+    size_t  userMemorySize;            ///< the size of the user-portion of the memory block
+    const psMemoryId id;               ///< a unique ID for this allocation
+    const char* file;                  ///< set from __FILE__ in e.g. p_psAlloc
+    const int lineno;                  ///< set from __LINE__ in e.g. p_psAlloc
+    pthread_mutex_t   refCounterMutex; ///< mutex to ensure exclusive access to reference counter
+    psReferenceCount refCounter;       ///< how many times pointer is referenced
+    const void* endblock;              ///< initialised to p_psMEMMAGIC
 }
 psMemBlock;
@@ -114,10 +118,8 @@
 );
 
-typedef void (*psFreeFcn)(void* ptr);
-
 /** Memory allocation.  This operates much like malloc(), but is guaranteed to return a non-NULL value.
  *
  *  @return void* pointer to the allocated buffer. This will not be NULL.
- *  @see psFree
+ *  @see psFree 
  */
 #ifdef DOXYGEN
@@ -131,4 +133,8 @@
     int lineno                      ///< Line number of call
 );
+
+void p_psMemSetDeallocator(void* ptr, psFreeFcn freeFcn);
+psFreeFcn p_psMemGetDeallocator(void* ptr);
+
 /// Memory allocation. psAlloc sends file and line number to p_psAlloc.
 #define psAlloc(size) p_psAlloc(size, __FILE__, __LINE__)
@@ -282,12 +288,7 @@
 );
 
-#define PS_FREE     (void*)1
-
 //@} End of Memory Management Functions
 
-
 #ifndef DOXYGEN
-
-void p_psCustomFree(psFreeFcn fcn,void* ptr);
 
 /*
Index: /trunk/psLib/src/types/psBitSet.c
===================================================================
--- /trunk/psLib/src/types/psBitSet.c	(revision 1072)
+++ /trunk/psLib/src/types/psBitSet.c	(revision 1073)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-15 02:45:43 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -55,4 +55,6 @@
 /*  FUNCTION IMPLEMENTATION - LOCAL                                          */
 /*****************************************************************************/
+static void bitSetFree(psBitSet *restrict inBitSet);
+
 
 /** Private function to create a mask.
@@ -88,4 +90,5 @@
     numBytes = ceil(n/8.0);
     newObj = psAlloc(sizeof(psBitSet));
+    p_psMemSetDeallocator(newObj,(psFreeFcn)bitSetFree);
     newObj->n = numBytes;
 
@@ -98,5 +101,5 @@
 }
 
-void psBitSetFree(psBitSet *restrict inBitSet)
+static void bitSetFree(psBitSet *restrict inBitSet)
 {
     if(inBitSet == NULL) {
@@ -105,5 +108,4 @@
     }
     psFree(inBitSet->bits);
-    psFree(inBitSet);
 }
 
Index: /trunk/psLib/src/types/psBitSet.h
===================================================================
--- /trunk/psLib/src/types/psBitSet.h	(revision 1072)
+++ /trunk/psLib/src/types/psBitSet.h	(revision 1073)
@@ -12,6 +12,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-10 01:58:06 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -54,12 +54,4 @@
 psBitSet* psBitSetAlloc(
     int n   /**< Number of bits in psBitSet array */
-);
-
-/** Free a psBitSet
- *
- *  Deletes a psBitSet array.
- */
-void psBitSetFree(
-    psBitSet *restrict inMask  /**< Pointer to psBitSet to be deleted. */
 );
 
Index: /trunk/psLib/src/types/psList.c
===================================================================
--- /trunk/psLib/src/types/psList.c	(revision 1072)
+++ /trunk/psLib/src/types/psList.c	(revision 1073)
@@ -6,6 +6,6 @@
  *  @author Robert Daniel DeSonia, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-14 19:45:46 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -28,7 +28,8 @@
 
 // private functions.
-psListElem* listGetIterator(psList* list);
-int listGetIteratorIndex(psList* list);
-void listSetIterator(psList *list, int where, bool lockList);
+static psListElem* listGetIterator(psList* list);
+static int listGetIteratorIndex(psList* list);
+static void listSetIterator(psList *list, int where, bool lockList);
+static void listFree(psList *list);
 
 
@@ -36,4 +37,5 @@
 {
     psList *list = psAlloc(sizeof(psList));
+    p_psMemSetDeallocator(list,(psFreeFcn)listFree);
 
     list->size = 0;
@@ -41,4 +43,5 @@
     list->iter = ITER_INIT_HEAD;
     list->iterIndex = PS_LIST_HEAD;
+
     pthread_mutex_init(&(list->lock),NULL)
     ;
@@ -51,5 +54,5 @@
 }
 
-void psListFree(psList *list, psFreeFcn elemFree)
+static void listFree(psList *list)
 {
     if (list == NULL) {
@@ -63,5 +66,5 @@
         psListElem *next = ptr->next;
 
-        p_psCustomFree(elemFree, psMemDecrRefCounter(ptr->data));
+        psFree(ptr->data);
         psFree(ptr);
 
@@ -75,5 +78,4 @@
     ;
 
-    psFree(list);
 }
 
Index: /trunk/psLib/src/types/psList.h
===================================================================
--- /trunk/psLib/src/types/psList.h	(revision 1072)
+++ /trunk/psLib/src/types/psList.h	(revision 1073)
@@ -10,6 +10,6 @@
  *  @ingroup LinkedList
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-12 22:15:39 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -73,15 +73,4 @@
 )
 ;
-
-#include "psMemory.h"
-/** Destroys a psList linked list object.  This also frees the elements of the
- *  list using the psFreeFcn given, if any.  If no psFreeFcn is specified,
- *  the elements are just dereferenced via psMemDecrRefCounter(...).
- *
- */
-void psListFree(
-    psList* restrict list,              ///< list to destroy
-    psFreeFcn elemFree                  ///< destructor for data on list
-);
 
 /** Adds an element to a psList at position given.
Index: /trunk/psLib/test/FullUnitTest
===================================================================
--- /trunk/psLib/test/FullUnitTest	(revision 1072)
+++ /trunk/psLib/test/FullUnitTest	(revision 1073)
@@ -19,6 +19,6 @@
 #  RETURN : integer number of tests which failed
 #
-#  $Revision: 1.7 $  $Name: not supported by cvs2svn $
-#  $Date: 2004-06-15 00:19:42 $
+#  $Revision: 1.8 $  $Name: not supported by cvs2svn $
+#  $Date: 2004-06-23 23:00:15 $
 #
 #  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -302,6 +302,7 @@
             $retVal = $?;
             # Count testpoints
-            $totalPoints = `grep -c '***** TESTPOINT *****' temp/$files[$j].stdout`;
-            $totalPoints += `grep -c '***** TESTPOINT *****' temp/$files[$j].stderr`;
+	    $testPattern = "\"\\*\\*\\*\\* TESTPOINT \\*\\*\\*\\*\"";
+            $totalPoints = `grep -c $testPattern temp/$files[$j].stdout`;
+            $totalPoints += `grep -c $testPattern temp/$files[$j].stderr`;
             $failPoints = `grep "> TESTPOINT FAILED" temp/$files[$j].stdout | wc -l`;
             $failPoints += `grep "> TESTPOINT FAILED" temp/$files[$j].stderr | wc -l`;
Index: /trunk/psLib/test/collections/builddir/tst_psBitSet_01.d
===================================================================
--- /trunk/psLib/test/collections/builddir/tst_psBitSet_01.d	(revision 1072)
+++ /trunk/psLib/test/collections/builddir/tst_psBitSet_01.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/collections/builddir/tst_psBitSet_02.d
===================================================================
--- /trunk/psLib/test/collections/builddir/tst_psBitSet_02.d	(revision 1072)
+++ /trunk/psLib/test/collections/builddir/tst_psBitSet_02.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/collections/builddir/tst_psBitSet_03.d
===================================================================
--- /trunk/psLib/test/collections/builddir/tst_psBitSet_03.d	(revision 1072)
+++ /trunk/psLib/test/collections/builddir/tst_psBitSet_03.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/collections/builddir/tst_psBitSet_04.d
===================================================================
--- /trunk/psLib/test/collections/builddir/tst_psBitSet_04.d	(revision 1072)
+++ /trunk/psLib/test/collections/builddir/tst_psBitSet_04.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/collections/builddir/tst_psBitSet_05.d
===================================================================
--- /trunk/psLib/test/collections/builddir/tst_psBitSet_05.d	(revision 1072)
+++ /trunk/psLib/test/collections/builddir/tst_psBitSet_05.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/collections/builddir/tst_psBitSet_06.d
===================================================================
--- /trunk/psLib/test/collections/builddir/tst_psBitSet_06.d	(revision 1072)
+++ /trunk/psLib/test/collections/builddir/tst_psBitSet_06.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/collections/builddir/tst_psImage.d
===================================================================
--- /trunk/psLib/test/collections/builddir/tst_psImage.d	(revision 1072)
+++ /trunk/psLib/test/collections/builddir/tst_psImage.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h
Index: /trunk/psLib/test/collections/builddir/tst_psList.d
===================================================================
--- /trunk/psLib/test/collections/builddir/tst_psList.d	(revision 1072)
+++ /trunk/psLib/test/collections/builddir/tst_psList.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h
Index: /trunk/psLib/test/collections/builddir/tst_psSort_01.d
===================================================================
--- /trunk/psLib/test/collections/builddir/tst_psSort_01.d	(revision 1072)
+++ /trunk/psLib/test/collections/builddir/tst_psSort_01.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/collections/builddir/tst_psSort_02.d
===================================================================
--- /trunk/psLib/test/collections/builddir/tst_psSort_02.d	(revision 1072)
+++ /trunk/psLib/test/collections/builddir/tst_psSort_02.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/collections/builddir/tst_psSort_03.d
===================================================================
--- /trunk/psLib/test/collections/builddir/tst_psSort_03.d	(revision 1072)
+++ /trunk/psLib/test/collections/builddir/tst_psSort_03.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/collections/builddir/tst_psSort_04.d
===================================================================
--- /trunk/psLib/test/collections/builddir/tst_psSort_04.d	(revision 1072)
+++ /trunk/psLib/test/collections/builddir/tst_psSort_04.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/collections/builddir/tst_psVector_01.d
===================================================================
--- /trunk/psLib/test/collections/builddir/tst_psVector_01.d	(revision 1072)
+++ /trunk/psLib/test/collections/builddir/tst_psVector_01.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/collections/builddir/tst_psVector_02.d
===================================================================
--- /trunk/psLib/test/collections/builddir/tst_psVector_02.d	(revision 1072)
+++ /trunk/psLib/test/collections/builddir/tst_psVector_02.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/collections/builddir/tst_psVector_03.d
===================================================================
--- /trunk/psLib/test/collections/builddir/tst_psVector_03.d	(revision 1072)
+++ /trunk/psLib/test/collections/builddir/tst_psVector_03.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/collections/tst_psBitSet_01.c
===================================================================
--- /trunk/psLib/test/collections/tst_psBitSet_01.c	(revision 1072)
+++ /trunk/psLib/test/collections/tst_psBitSet_01.c	(revision 1073)
@@ -17,6 +17,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-10 00:28:23 $
+ *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -121,5 +121,5 @@
     // Test J - Free psBitSet
     printPositiveTestHeader(stdout, "psBitSet", "Free psBitSet");
-    psBitSetFree(bs);
+    psFree(bs);
     psMemCheckLeaks(0, NULL, stdout);
     psMemCheckCorruption(0);
Index: /trunk/psLib/test/collections/tst_psBitSet_02.c
===================================================================
--- /trunk/psLib/test/collections/tst_psBitSet_02.c	(revision 1072)
+++ /trunk/psLib/test/collections/tst_psBitSet_02.c	(revision 1073)
@@ -10,6 +10,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-11 01:39:30 $
+ *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -63,7 +63,7 @@
     // Test C - Free psBitSets
     printPositiveTestHeader(stdout, "psBitSet", "Free psBitSets");
-    psBitSetFree(bs1);
-    psBitSetFree(bs2);
-    psBitSetFree(outbs);
+    psFree(bs1);
+    psFree(bs2);
+    psFree(outbs);
     psMemCheckLeaks(0, NULL, stdout);
     int nBad = psMemCheckCorruption(0);
Index: /trunk/psLib/test/collections/tst_psBitSet_03.c
===================================================================
--- /trunk/psLib/test/collections/tst_psBitSet_03.c	(revision 1072)
+++ /trunk/psLib/test/collections/tst_psBitSet_03.c	(revision 1073)
@@ -10,6 +10,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-11 01:40:45 $
+ *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -63,7 +63,7 @@
     // Test C - Free psBitSets
     printPositiveTestHeader(stdout, "psBitSet", "Free psBitSets");
-    psBitSetFree(bs1);
-    psBitSetFree(bs2);
-    psBitSetFree(outbs);
+    psFree(bs1);
+    psFree(bs2);
+    psFree(outbs);
     psMemCheckLeaks(0, NULL, stdout);
     int nBad = psMemCheckCorruption(0);
Index: /trunk/psLib/test/collections/tst_psBitSet_04.c
===================================================================
--- /trunk/psLib/test/collections/tst_psBitSet_04.c	(revision 1072)
+++ /trunk/psLib/test/collections/tst_psBitSet_04.c	(revision 1073)
@@ -10,6 +10,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-11 01:46:02 $
+ *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -63,7 +63,7 @@
     // Test C - Free psBitSets
     printPositiveTestHeader(stdout, "psBitSet", "Free psBitSets");
-    psBitSetFree(bs1);
-    psBitSetFree(bs2);
-    psBitSetFree(outbs);
+    psFree(bs1);
+    psFree(bs2);
+    psFree(outbs);
     psMemCheckLeaks(0, NULL, stdout);
     int nBad = psMemCheckCorruption(0);
Index: /trunk/psLib/test/collections/tst_psBitSet_05.c
===================================================================
--- /trunk/psLib/test/collections/tst_psBitSet_05.c	(revision 1072)
+++ /trunk/psLib/test/collections/tst_psBitSet_05.c	(revision 1073)
@@ -10,6 +10,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-10 00:28:36 $
+ *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -48,7 +48,7 @@
     // Test C - Free psBitSets
     printPositiveTestHeader(stdout, "psBitSet", "Free psBitSets");
-    psBitSetFree(bs1);
-    psBitSetFree(bs2);
-    psBitSetFree(outbs);
+    psFree(bs1);
+    psFree(bs2);
+    psFree(outbs);
     psMemCheckLeaks(0, NULL, stdout);
     int nBad = psMemCheckCorruption(0);
Index: /trunk/psLib/test/collections/tst_psBitSet_06.c
===================================================================
--- /trunk/psLib/test/collections/tst_psBitSet_06.c	(revision 1072)
+++ /trunk/psLib/test/collections/tst_psBitSet_06.c	(revision 1073)
@@ -12,6 +12,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-10 00:28:43 $
+ *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -55,17 +55,9 @@
     printFooter(stdout, "psBitSet", "Create negative size bitset", true);
 
-
-    // Test D - Attempt to free null BitSet
-    printNegativeTestHeader(stdout,"psBitSet", "Attempt to free null BitSet",
-                            "Null psBitSet for inBitSet argument", 0);
-    psBitSetFree(NULL);
-    printFooter(stdout, "psBitSet", "Attempt to free null BitSet", true);
-
-
     // Test E - Free psBitSets
     printPositiveTestHeader(stdout, "psBitSet", "Free psBitSets");
-    psBitSetFree(bs1);
-    psBitSetFree(bs2);
-    psBitSetFree(outbs);
+    psFree(bs1);
+    psFree(bs2);
+    psFree(outbs);
     psMemCheckLeaks(0, NULL, stdout);
     int nBad = psMemCheckCorruption(0);
Index: /trunk/psLib/test/collections/tst_psList.c
===================================================================
--- /trunk/psLib/test/collections/tst_psList.c	(revision 1072)
+++ /trunk/psLib/test/collections/tst_psList.c	(revision 1073)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-14 23:03:43 $
+ *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -78,5 +78,5 @@
     }
 
-    psListFree(list,NULL);
+    psFree(list);
 
     list = psListAlloc(data);
@@ -108,5 +108,7 @@
 
 
-    psListFree(list,PS_FREE);
+    psFree(list);
+
+    psFree(data);
 
     return 0;
@@ -283,5 +285,5 @@
     }
 
-    psListFree(list, PS_FREE);
+    psFree(list);
 
     return 0;
@@ -339,16 +341,20 @@
     *data = 0;
     list = psListAlloc(data);
+    psFree(data);
 
     data = psAlloc(sizeof(int));
     *data = 1;
     list = psListAdd(list,data,PS_LIST_TAIL);
+    psFree(data);
 
     data = psAlloc(sizeof(int));
     *data = 2;
     list = psListAdd(list,data,PS_LIST_TAIL);
+    psFree(data);
 
     data = psAlloc(sizeof(int));
     *data = 3;
     list = psListAdd(list,data,PS_LIST_TAIL);
+    psFree(data);
 
     //  2. which>0 and which<list.n.
@@ -404,5 +410,5 @@
     }
 
-    psListFree(list,PS_FREE);
+    psFree(list);
 
     return 0;
@@ -637,5 +643,5 @@
     }
 
-    psListFree(list,PS_FREE);
+    psFree(list);
 
     return 0;
@@ -691,6 +697,6 @@
     }
 
-    psVectorFree(vec);
-    psListFree(list,PS_FREE);
+    psFree(vec);
+    psFree(list);
 
     // test vector -> dlist
@@ -729,6 +735,6 @@
     }
 
-    psVectorFree(vec);
-    psListFree(list,PS_FREE);
+    psFree(vec);
+    psFree(list);
 
     // now, make sure if input vector/list is NULL, output is NULL
@@ -755,6 +761,6 @@
         return 1;
     }
-    psVectorFree(vec);
-    psListFree(list,PS_FREE);
+    psFree(vec);
+    psFree(list);
 
     list = psListAlloc(NULL);
@@ -765,6 +771,6 @@
         return 1;
     }
-    psVectorFree(vec);
-    psListFree(list,PS_FREE);
+    psFree(vec);
+    psFree(list);
 
     return 0;
@@ -895,5 +901,5 @@
     }
 
-    psListFree(list,PS_FREE);
+    psFree(list);
 
     return 0;
@@ -938,5 +944,5 @@
     */
 
-    psListFree(list,NULL);
+    psFree(list);
 
     /*
Index: /trunk/psLib/test/collections/tst_psSort_01.c
===================================================================
--- /trunk/psLib/test/collections/tst_psSort_01.c	(revision 1072)
+++ /trunk/psLib/test/collections/tst_psSort_01.c	(revision 1073)
@@ -10,6 +10,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-10 23:14:22 $
+ *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -71,6 +71,6 @@
     // Test D - Free float vectors
     printPositiveTestHeader(stdout,"psSort", "Free float vectors");
-    psVectorFree(in);
-    psVectorFree(out);
+    psFree(in);
+    psFree(out);
     psMemCheckLeaks(0, NULL, stdout);
     int nBad = psMemCheckCorruption(0);
Index: /trunk/psLib/test/collections/tst_psSort_02.c
===================================================================
--- /trunk/psLib/test/collections/tst_psSort_02.c	(revision 1072)
+++ /trunk/psLib/test/collections/tst_psSort_02.c	(revision 1073)
@@ -10,6 +10,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-02 23:29:29 $
+ *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -55,6 +55,6 @@
     // Test C - Free vectors
     printPositiveTestHeader(stdout,"psSort", "Free vectors");
-    psVectorFree(in);
-    psVectorFree(out);
+    psFree(in);
+    psFree(out);
     psMemCheckLeaks(0, NULL, stdout);
     int nBad = psMemCheckCorruption(0);
Index: /trunk/psLib/test/collections/tst_psSort_03.c
===================================================================
--- /trunk/psLib/test/collections/tst_psSort_03.c	(revision 1072)
+++ /trunk/psLib/test/collections/tst_psSort_03.c	(revision 1073)
@@ -10,6 +10,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-02 23:29:29 $
+ *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -49,6 +49,6 @@
     // Test C - Free float vectors
     printPositiveTestHeader(stdout,"psSort", "Free float vectors");
-    psVectorFree(in);
-    psVectorFree(out);
+    psFree(in);
+    psFree(out);
     psMemCheckLeaks(0, NULL, stdout);
     int nBad = psMemCheckCorruption(0);
Index: /trunk/psLib/test/collections/tst_psSort_04.c
===================================================================
--- /trunk/psLib/test/collections/tst_psSort_04.c	(revision 1072)
+++ /trunk/psLib/test/collections/tst_psSort_04.c	(revision 1073)
@@ -9,6 +9,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-10 23:14:22 $
+ *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -33,5 +33,5 @@
     // Test B - Free vectors
     printPositiveTestHeader(stdout, "psSort", "Free vectors");
-    psVectorFree(goodOut);
+    psFree(goodOut);
     psMemCheckLeaks(0, NULL, stdout);
     int nBad = psMemCheckCorruption(0);
Index: /trunk/psLib/test/collections/tst_psVector_01.c
===================================================================
--- /trunk/psLib/test/collections/tst_psVector_01.c	(revision 1072)
+++ /trunk/psLib/test/collections/tst_psVector_01.c	(revision 1073)
@@ -14,6 +14,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.7 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-10 01:50:43 $
+ *  @version $Revision: 1.8 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -79,5 +79,5 @@
     // Test E - Free S32 vector
     printPositiveTestHeader(stdout, "psVector", "Free S32 vector");
-    psVectorFree(psVec);
+    psFree(psVec);
     psMemCheckLeaks(0, NULL, stdout);
     int nBad = psMemCheckCorruption(0);
Index: /trunk/psLib/test/collections/tst_psVector_02.c
===================================================================
--- /trunk/psLib/test/collections/tst_psVector_02.c	(revision 1072)
+++ /trunk/psLib/test/collections/tst_psVector_02.c	(revision 1073)
@@ -12,6 +12,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-02 23:29:29 $
+ *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -102,6 +102,6 @@
     // Test E - Free void pointer vector
     printPositiveTestHeader(stdout, "psVector", "Free void pointer vector");
-    psVectorElementFree(psVec, NULL);
-    psVectorFree(psVec);
+    psVectorElementFree(psVec);
+    psFree(psVec);
     for(int i = 0; i < 10; i++) {
         psFree(mySt[i]);
Index: /trunk/psLib/test/collections/tst_psVector_03.c
===================================================================
--- /trunk/psLib/test/collections/tst_psVector_03.c	(revision 1072)
+++ /trunk/psLib/test/collections/tst_psVector_03.c	(revision 1073)
@@ -12,6 +12,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-04 19:51:49 $
+ *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -28,10 +28,4 @@
 }
 testStruct;
-
-static void freeData(void *data)
-{
-    psFree(data);
-}
-
 
 int main(int argc,
@@ -59,5 +53,4 @@
         psVec->data.PTR[i] = ts;
         psVec->n++;
-        psMemIncrRefCounter(ts);
     }
 
@@ -82,5 +75,4 @@
         psVec->data.PTR[i] = ts;
         psVec->n++;
-        psMemIncrRefCounter(ts);
     }
     for(int i = 0; i < 10; i++) {
@@ -92,8 +84,7 @@
     printFooter(stdout, "psVector", "Reallocate void pointer vector bigger", true);
 
-
     // Test D - Reallocate void pointer vector smaller
     printPositiveTestHeader(stdout,"psVector","Reallocate void pointer vector smaller");
-    psVec = psVectorRealloc(3, psVec);
+    psVec = psVectorRealloc(3, psVec); // this also frees the elements trimmed
     for(int i = 0; i < 3; i++) {
         testStruct *ts = (testStruct*)psVec->data.PTR[i];
@@ -109,12 +100,9 @@
 
     // Free void pointer array struct and its 3 internal elements
-    psVectorElementFree(psVec, freeData);
-    psVectorFree(psVec);
+    psFree(psVec);
 
-    // Free 7 elements manually that were lost after array was reallocated smaller
-    for(int i = 3; i < 10; i++) {
-        psFree(mySt[i]);
+    if (psMemCheckLeaks(0, NULL, stdout) != 0) {
+        psAbort(__func__,"memory leaks");
     }
-    psMemCheckLeaks(0, NULL, stdout);
     int nBad = psMemCheckCorruption(0);
     if(nBad) {
Index: /trunk/psLib/test/collections/verified/tst_psBitSet_01.stderr
===================================================================
--- /trunk/psLib/test/collections/verified/tst_psBitSet_01.stderr	(revision 1072)
+++ /trunk/psLib/test/collections/verified/tst_psBitSet_01.stderr	(revision 1073)
@@ -1,6 +1,6 @@
- <DATE> <TIME> <HOST> |E|   psBitSetTest| : Line 140 - Bit position too small: -4
- <DATE> <TIME> <HOST> |E|   psBitSetTest| : Line 143 - Bit position too large: 200
- <DATE> <TIME> <HOST> |E|   psBitSetTest| : Line 137 - Null psBitSet for inBitSet argument
- <DATE> <TIME> <HOST> |E|    psBitSetSet| : Line 118 - Bit position too small: -4
- <DATE> <TIME> <HOST> |E|    psBitSetSet| : Line 121 - Bit position too large: 200
- <DATE> <TIME> <HOST> |E|    psBitSetSet| : Line 115 - Null psBitSet for inBitSet argument
+ <DATE> <TIME> <HOST> |E|   psBitSetTest| : Line 142 - Bit position too small: -4
+ <DATE> <TIME> <HOST> |E|   psBitSetTest| : Line 145 - Bit position too large: 200
+ <DATE> <TIME> <HOST> |E|   psBitSetTest| : Line 139 - Null psBitSet for inBitSet argument
+ <DATE> <TIME> <HOST> |E|    psBitSetSet| : Line 120 - Bit position too small: -4
+ <DATE> <TIME> <HOST> |E|    psBitSetSet| : Line 123 - Bit position too large: 200
+ <DATE> <TIME> <HOST> |E|    psBitSetSet| : Line 117 - Null psBitSet for inBitSet argument
Index: /trunk/psLib/test/collections/verified/tst_psBitSet_05.stderr
===================================================================
--- /trunk/psLib/test/collections/verified/tst_psBitSet_05.stderr	(revision 1072)
+++ /trunk/psLib/test/collections/verified/tst_psBitSet_05.stderr	(revision 1073)
@@ -1,1 +1,1 @@
- <DATE> <TIME> <HOST> |E|     psBitSetOp| : Line 187 - psBitSet sizes not the same
+ <DATE> <TIME> <HOST> |E|     psBitSetOp| : Line 189 - psBitSet sizes not the same
Index: /trunk/psLib/test/collections/verified/tst_psBitSet_06.stderr
===================================================================
--- /trunk/psLib/test/collections/verified/tst_psBitSet_06.stderr	(revision 1072)
+++ /trunk/psLib/test/collections/verified/tst_psBitSet_06.stderr	(revision 1073)
@@ -1,3 +1,2 @@
- <DATE> <TIME> <HOST> |E|     psBitSetOp| : Line 214 - Invalid psBitMask binary operation: ZZXOR
- <DATE> <TIME> <HOST> |E|  psBitSetAlloc| : Line 84 - Allocation size must be > 0: size = -4
- <DATE> <TIME> <HOST> |E|   psBitSetFree| : Line 103 - Null psBitSet for inBitSet argument
+ <DATE> <TIME> <HOST> |E|     psBitSetOp| : Line 216 - Invalid psBitMask binary operation: ZZXOR
+ <DATE> <TIME> <HOST> |E|  psBitSetAlloc| : Line 86 - Allocation size must be > 0: size = -4
Index: /trunk/psLib/test/collections/verified/tst_psBitSet_06.stdout
===================================================================
--- /trunk/psLib/test/collections/verified/tst_psBitSet_06.stdout	(revision 1072)
+++ /trunk/psLib/test/collections/verified/tst_psBitSet_06.stdout	(revision 1073)
@@ -35,15 +35,4 @@
 /***************************** TESTPOINT ******************************************\
 *             TestFile: tst_psBitSet_06.c                                          *
-*            TestPoint: psBitSet{Attempt to free null BitSet}                      *
-*             TestType: Negative                                                   *
-*    ExpectedErrorText: Null psBitSet for inBitSet argument                        *
-*  ExpectedStatusValue: 0                                                          *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (psBitSet{Attempt to free null BitSet} | tst_psBitSet_06.c)
-
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psBitSet_06.c                                          *
 *            TestPoint: psBitSet{Free psBitSets}                                   *
 *             TestType: Positive                                                   *
Index: /trunk/psLib/test/collections/verified/tst_psList.stderr
===================================================================
--- /trunk/psLib/test/collections/verified/tst_psList.stderr	(revision 1072)
+++ /trunk/psLib/test/collections/verified/tst_psList.stderr	(revision 1073)
@@ -30,5 +30,5 @@
 
  <DATE> <TIME> <HOST> |I|    testListGet|Following should be an error
- <DATE> <TIME> <HOST> |E|listSetIterator|Unexpected null pointer for psList parameter (psList.c:264).
+ <DATE> <TIME> <HOST> |E|listSetIterator|Unexpected null pointer for psList parameter (psList.c:262).
 
 ---> TESTPOINT PASSED (psList{489-testListGet} | tst_psList.c)
@@ -70,5 +70,5 @@
  <DATE> <TIME> <HOST> |I|testListIterato| psListSetIterator/psListGetNext/psListGetPrev shall move the list cursor to the specified location
  <DATE> <TIME> <HOST> |I|testListIterato|Following should error with 'Unexpected null pointer'
- <DATE> <TIME> <HOST> |E|listSetIterator|Unexpected null pointer for psList parameter (psList.c:264).
+ <DATE> <TIME> <HOST> |E|listSetIterator|Unexpected null pointer for psList parameter (psList.c:262).
  <DATE> <TIME> <HOST> |I|testListIterato|Following should error with 'Can't move to an unknown position.'
  <DATE> <TIME> <HOST> |E|listSetIterator|Can't move to an unknown position.  Not moving the iterator position.
Index: /trunk/psLib/test/collections/verified/tst_psSort_03.stderr
===================================================================
--- /trunk/psLib/test/collections/verified/tst_psSort_03.stderr	(revision 1072)
+++ /trunk/psLib/test/collections/verified/tst_psSort_03.stderr	(revision 1073)
@@ -1,1 +1,1 @@
- <DATE> <TIME> <HOST> |E|         psSort| : Line 136 - Input and output vector sizes are not equal: in=5 out=6
+ <DATE> <TIME> <HOST> |E|         psSort| : Line 137 - Input and output vector sizes are not equal: in=5 out=6
Index: /trunk/psLib/test/collections/verified/tst_psSort_04.stderr
===================================================================
--- /trunk/psLib/test/collections/verified/tst_psSort_04.stderr	(revision 1072)
+++ /trunk/psLib/test/collections/verified/tst_psSort_04.stderr	(revision 1073)
@@ -1,1 +1,1 @@
- <DATE> <TIME> <HOST> |E|         psSort| : Line 118 - Null input vector
+ <DATE> <TIME> <HOST> |E|         psSort| : Line 119 - Null input vector
Index: /trunk/psLib/test/dataManip/tst_psFunc00.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psFunc00.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psFunc00.c	(revision 1073)
@@ -53,5 +53,5 @@
            psEvalPolynomial1D(MISC_X_VALUE, my1DPoly));
 
-    psPolynomial1DFree(my1DPoly);
+    psFree(my1DPoly);
     memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
     if (0 != memLeaks) {
@@ -83,5 +83,5 @@
            psEvalPolynomial2D(MISC_X_VALUE, MISC_X_VALUE, my2DPoly));
 
-    psPolynomial2DFree(my2DPoly);
+    psFree(my2DPoly);
     memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
     if (0 != memLeaks) {
@@ -114,5 +114,5 @@
            psEvalPolynomial3D(MISC_X_VALUE, MISC_X_VALUE, MISC_X_VALUE, my3DPoly));
 
-    psPolynomial3DFree(my3DPoly);
+    psFree(my3DPoly);
     memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
     if (0 != memLeaks) {
@@ -148,5 +148,5 @@
            psEvalPolynomial4D(MISC_X_VALUE, MISC_X_VALUE, MISC_X_VALUE, MISC_X_VALUE, my4DPoly));
 
-    psPolynomial4DFree(my4DPoly);
+    psFree(my4DPoly);
     memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
     if (0 != memLeaks) {
@@ -178,5 +178,5 @@
            psDEvalPolynomial1D(MISC_X_VALUE, my1DPolyD));
 
-    psDPolynomial1DFree(my1DPolyD);
+    psFree(my1DPolyD);
     memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
     if (0 != memLeaks) {
@@ -187,8 +187,4 @@
                 "Allocate/Deallocate the psDPolynomial1D structure.",
                 testStatus);
-
-
-
-
 
     printPositiveTestHeader(stdout,
@@ -208,5 +204,5 @@
            psDEvalPolynomial2D(MISC_X_VALUE, MISC_X_VALUE, my2DPolyD));
 
-    psDPolynomial2DFree(my2DPolyD);
+    psFree(my2DPolyD);
     memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
     if (0 != memLeaks) {
@@ -239,5 +235,5 @@
            psDEvalPolynomial3D(MISC_X_VALUE, MISC_X_VALUE, MISC_X_VALUE, my3DPolyD));
 
-    psDPolynomial3DFree(my3DPolyD);
+    psFree(my3DPolyD);
     memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
     if (0 != memLeaks) {
@@ -273,5 +269,5 @@
            psDEvalPolynomial4D(MISC_X_VALUE, MISC_X_VALUE, MISC_X_VALUE, MISC_X_VALUE, my4DPolyD));
 
-    psDPolynomial4DFree(my4DPolyD);
+    psFree(my4DPolyD);
     memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
     if (0 != memLeaks) {
Index: /trunk/psLib/test/dataManip/tst_psFunc01.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psFunc01.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psFunc01.c	(revision 1073)
@@ -56,5 +56,5 @@
     }
 
-    psVectorFree(myGaussData);
+    psFree(myGaussData);
 
     psMemCheckCorruption(1);
Index: /trunk/psLib/test/dataManip/tst_psHist00.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psHist00.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psHist00.c	(revision 1073)
@@ -79,5 +79,5 @@
 
         psMemCheckCorruption(1);
-        psHistogramFree(myHist);
+        psFree(myHist);
         psMemCheckCorruption(1);
 
Index: /trunk/psLib/test/dataManip/tst_psHist01.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psHist01.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psHist01.c	(revision 1073)
@@ -84,7 +84,7 @@
         }
         psMemCheckCorruption(1);
-        psHistogramFree(myHist);
+        psFree(myHist);
         psMemCheckCorruption(1);
-        psVectorFree(myBounds);
+        psFree(myBounds);
 
         printFooter(stdout,
Index: /trunk/psLib/test/dataManip/tst_psHist02.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psHist02.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psHist02.c	(revision 1073)
@@ -75,5 +75,5 @@
         }
         psMemCheckCorruption(1);
-        psHistogramFree(myHist);
+        psFree(myHist);
         psMemCheckCorruption(1);
 
@@ -100,5 +100,5 @@
         }
         psMemCheckCorruption(1);
-        psHistogramFree(myHist);
+        psFree(myHist);
         psMemCheckCorruption(1);
 
@@ -108,5 +108,5 @@
                     testStatus);
     }
-    psVectorFree(myMask);
+    psFree(myMask);
 
     printPositiveTestHeader(stdout,
@@ -122,5 +122,5 @@
         testStatus = false;
     }
-    psVectorFree(myData);
+    psFree(myData);
 
 
@@ -135,5 +135,5 @@
         testStatus = false;
     }
-    psHistogramFree(myHist);
+    psFree(myHist);
 
 
@@ -152,6 +152,6 @@
         testStatus = false;
     }
-    psHistogramFree(myHist);
-    psVectorFree(myData);
+    psFree(myHist);
+    psFree(myData);
     */
     printFooter(stdout,
Index: /trunk/psLib/test/dataManip/tst_psMatrix01.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psMatrix01.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psMatrix01.c	(revision 1073)
@@ -11,6 +11,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-07 20:47:52 $
+ *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -75,7 +75,7 @@
     // Test D - Free images and check for leaks
     printPositiveTestHeader(stdout, "psMatrix", "Free images and check for leaks");
-    psImageFree(inImage);
-    psImageFree(outImage);
-    psImageFree(outImageNull);
+    psFree(inImage);
+    psFree(outImage);
+    psFree(outImageNull);
     psMemCheckLeaks(0, NULL, stdout);
     int nBad = psMemCheckCorruption(0);
Index: /trunk/psLib/test/dataManip/tst_psMatrix03.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psMatrix03.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psMatrix03.c	(revision 1073)
@@ -14,6 +14,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.5 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-07 20:25:03 $
+ *  @version $Revision: 1.6 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -104,9 +104,9 @@
     // Test D - Free input and output images and vectors
     printPositiveTestHeader(stdout, "psMatrix", "Free input and output images and vectors");
-    psImageFree(inImage);
-    psImageFree(luImage);
-    psVectorFree(perm);
-    psVectorFree(outVector);
-    psVectorFree(inVector);
+    psFree(inImage);
+    psFree(luImage);
+    psFree(perm);
+    psFree(outVector);
+    psFree(inVector);
     psMemCheckLeaks(0, NULL, stdout);
     int nBad = psMemCheckCorruption(0);
Index: /trunk/psLib/test/dataManip/tst_psMatrix04.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psMatrix04.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psMatrix04.c	(revision 1073)
@@ -13,6 +13,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-07 20:25:03 $
+ *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -82,6 +82,6 @@
     // Test D - Free input and output images
     printPositiveTestHeader(stdout, "psMatrix", "Free input and output images");
-    psImageFree(outImage);
-    psImageFree(inImage);
+    psFree(outImage);
+    psFree(inImage);
     psFree(det2);
     psMemCheckLeaks(0, NULL, stdout);
Index: /trunk/psLib/test/dataManip/tst_psMatrix05.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psMatrix05.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psMatrix05.c	(revision 1073)
@@ -10,6 +10,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-05-28 02:52:23 $
+ *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -65,7 +65,7 @@
     // Test C - Free input and output images
     printPositiveTestHeader(stdout, "psMatrix", "Free input and output images");
-    psImageFree(outImage);
-    psImageFree(inImage1);
-    psImageFree(inImage2);
+    psFree(outImage);
+    psFree(inImage1);
+    psFree(inImage2);
     psMemCheckLeaks(0, NULL, stdout);
     int nBad = psMemCheckCorruption(0);
Index: /trunk/psLib/test/dataManip/tst_psMatrix06.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psMatrix06.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psMatrix06.c	(revision 1073)
@@ -10,6 +10,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-05-28 02:52:23 $
+ *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -74,6 +74,6 @@
     // Test C - Free input and output images
     printPositiveTestHeader(stdout, "psMatrix", "Free input and output images");
-    psImageFree(outImage);
-    psImageFree(inImage);
+    psFree(outImage);
+    psFree(inImage);
     psMemCheckLeaks(0, NULL, stdout);
     int nBad = psMemCheckCorruption(0);
Index: /trunk/psLib/test/dataManip/tst_psMatrix07.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psMatrix07.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psMatrix07.c	(revision 1073)
@@ -16,6 +16,6 @@
  *  @author  Ross Harman, MHPCC
  *
- *  @version $Revision: 1.3 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2004-06-08 01:56:35 $
+ *  @version $Revision: 1.4 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2004-06-23 23:00:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -157,11 +157,11 @@
     // Test I - Free input and output images
     printPositiveTestHeader(stdout, "psMatrix", "Free input and output images and vectors");
-    psImageFree(m1);
-    psVectorFree(v1);
-    psImageFree(m2);
-    psVectorFree(v2);
-    psImageFree(m3);
-    psImageFree(m4);
-    psImageFree(badImage);
+    psFree(m1);
+    psFree(v1);
+    psFree(m2);
+    psFree(v2);
+    psFree(m3);
+    psFree(m4);
+    psFree(badImage);
     psMemCheckLeaks(0, NULL, stdout);
     int nBad = psMemCheckCorruption(0);
Index: /trunk/psLib/test/dataManip/tst_psStats00.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psStats00.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psStats00.c	(revision 1073)
@@ -186,7 +186,7 @@
                             "psStats(): deallocating memory");
 
-    psStatsFree(myStats);
-    psVectorFree(myVector);
-    psVectorFree(maskVector);
+    psFree(myStats);
+    psFree(myVector);
+    psFree(maskVector);
 
     psMemCheckCorruption(1);
Index: /trunk/psLib/test/dataManip/tst_psStats01.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psStats01.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psStats01.c	(revision 1073)
@@ -107,7 +107,7 @@
                             "psStats(): deallocating memory");
 
-    psStatsFree(myStats);
-    psVectorFree(myVector);
-    psVectorFree(maskVector);
+    psFree(myStats);
+    psFree(myVector);
+    psFree(maskVector);
 
     psMemCheckCorruption(1);
Index: /trunk/psLib/test/dataManip/tst_psStats02.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psStats02.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psStats02.c	(revision 1073)
@@ -107,7 +107,7 @@
                             "psStats(): deallocating memory");
 
-    psStatsFree(myStats);
-    psVectorFree(myVector);
-    psVectorFree(maskVector);
+    psFree(myStats);
+    psFree(myVector);
+    psFree(maskVector);
 
     psMemCheckCorruption(1);
Index: /trunk/psLib/test/dataManip/tst_psStats03.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psStats03.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psStats03.c	(revision 1073)
@@ -102,7 +102,7 @@
                             "psStats(): deallocating memory");
 
-    psStatsFree(myStats);
-    psVectorFree(myVector);
-    psVectorFree(maskVector);
+    psFree(myStats);
+    psFree(myVector);
+    psFree(maskVector);
 
     psMemCheckCorruption(1);
Index: /trunk/psLib/test/dataManip/tst_psStats05.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psStats05.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psStats05.c	(revision 1073)
@@ -59,5 +59,5 @@
                             "psStats functions",
                             "Deallocate the psStats structure.");
-    psStatsFree(myStats);
+    psFree(myStats);
 
     psMemCheckCorruption(1);
@@ -73,16 +73,4 @@
                 testStatus);
 
-
-
-    printPositiveTestHeader(stdout,
-                            "psStats functions",
-                            "Deallocate NULL psStats structure.");
-    psStatsFree(NULL);
-    printFooter(stdout,
-                "psStats functions",
-                "Deallocate NULL psStats structure.",
-                testStatus);
-
-
     return (!testStatus);
 }
Index: /trunk/psLib/test/dataManip/tst_psStats06.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psStats06.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psStats06.c	(revision 1073)
@@ -110,7 +110,7 @@
                             "psStats(): deallocating memory");
 
-    psStatsFree(myStats);
-    psVectorFree(myVector);
-    psVectorFree(maskVector);
+    psFree(myStats);
+    psFree(myVector);
+    psFree(maskVector);
 
     psMemCheckCorruption(1);
Index: /trunk/psLib/test/dataManip/tst_psStats07.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psStats07.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psStats07.c	(revision 1073)
@@ -395,7 +395,7 @@
                             "psStats(): deallocating memory");
 
-    psStatsFree(myStats);
-    psVectorFree(myVector);
-    psVectorFree(maskVector);
+    psFree(myStats);
+    psFree(myVector);
+    psFree(maskVector);
 
     psMemCheckCorruption(1);
Index: /trunk/psLib/test/dataManip/tst_psStats08.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psStats08.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psStats08.c	(revision 1073)
@@ -154,7 +154,7 @@
                             "psStats(): deallocating memory");
 
-    psStatsFree(myStats);
-    psVectorFree(myVector);
-    psVectorFree(maskVector);
+    psFree(myStats);
+    psFree(myVector);
+    psFree(maskVector);
 
     psMemCheckCorruption(1);
Index: /trunk/psLib/test/dataManip/tst_psStats09.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psStats09.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psStats09.c	(revision 1073)
@@ -128,7 +128,7 @@
                             "psStats(): deallocating memory");
 
-    psStatsFree(myStats);
-    psVectorFree(myGaussData);
-    psVectorFree(maskVector);
+    psFree(myStats);
+    psFree(myGaussData);
+    psFree(maskVector);
 
     psMemCheckCorruption(1);
Index: /trunk/psLib/test/dataManip/tst_psVectorFFT.c
===================================================================
--- /trunk/psLib/test/dataManip/tst_psVectorFFT.c	(revision 1072)
+++ /trunk/psLib/test/dataManip/tst_psVectorFFT.c	(revision 1073)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-12 01:34:10 $
+ *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -112,7 +112,7 @@
     }
 
-    psVectorFree(vec);
-    psVectorFree(vec2);
-    psVectorFree(vec3);
+    psFree(vec);
+    psFree(vec2);
+    psFree(vec3);
 
     return 0;
@@ -177,7 +177,7 @@
     }
 
-    psVectorFree(vec);
-    psVectorFree(vec2);
-    psVectorFree(vec3);
+    psFree(vec);
+    psFree(vec2);
+    psFree(vec3);
 
     return 0;
@@ -262,7 +262,7 @@
     }
 
-    psVectorFree(vec);
-    psVectorFree(vec2);
-    psVectorFree(vec3);
+    psFree(vec);
+    psFree(vec2);
+    psFree(vec3);
 
     return 0;
@@ -307,6 +307,6 @@
     }
 
-    psVectorFree(vec);
-    psVectorFree(vec2);
+    psFree(vec);
+    psFree(vec2);
 
     return 0;
@@ -374,7 +374,7 @@
     };
 
-    psVectorFree(vec);
-    psVectorFree(vec2);
-
-    return 0;
-}
+    psFree(vec);
+    psFree(vec2);
+
+    return 0;
+}
Index: /trunk/psLib/test/dataManip/verified/tst_psStats05.stdout
===================================================================
--- /trunk/psLib/test/dataManip/verified/tst_psStats05.stdout	(revision 1072)
+++ /trunk/psLib/test/dataManip/verified/tst_psStats05.stdout	(revision 1073)
@@ -17,11 +17,2 @@
 ---> TESTPOINT PASSED (psStats functions{Deallocate the psStats structure.} | tst_psStats05.c)
 
-/***************************** TESTPOINT ******************************************\
-*             TestFile: tst_psStats05.c                                            *
-*            TestPoint: psStats functions{Deallocate NULL psStats structure.}      *
-*             TestType: Positive                                                   *
-\**********************************************************************************/
-
-
----> TESTPOINT PASSED (psStats functions{Deallocate NULL psStats structure.} | tst_psStats05.c)
-
Index: /trunk/psLib/test/image/tst_psImage.c
===================================================================
--- /trunk/psLib/test/image/tst_psImage.c	(revision 1072)
+++ /trunk/psLib/test/image/tst_psImage.c	(revision 1073)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-14 23:03:43 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:15 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -75,5 +75,5 @@
                 psError(__func__,"psImageAlloc returned NULL for type %x, size %dx%d.",
                         type[t], numCols[i], numRows[i]);
-                psImageFree(image);
+                psFree(image);
                 return 1;
             }
@@ -82,5 +82,5 @@
                 psError(__func__,"psImageAlloc allocated wrong dimen/type (%d/%d), should be "
                         "PS_IMAGE_DIMEN/%d", image->type.dimen, image->type.type, type[t]);
-                psImageFree(image);
+                psFree(image);
                 return 2;
             }
@@ -89,5 +89,5 @@
                 psError(__func__,"psImageAlloc allocated wrong size %dx%d, should be %dx%d (type = %d)",
                         image->numCols, image->numRows, numCols[i], numRows[i],type[t]);
-                psImageFree(image);
+                psFree(image);
                 return 3;
             }
@@ -96,5 +96,5 @@
                 psError(__func__,"psImageAlloc returned row0/col0 of %d/%d.  Should be 0/0.",
                         image->row0, image->row0);
-                psImageFree(image);
+                psFree(image);
                 return 4;
             }
@@ -102,5 +102,5 @@
             if (image->parent != NULL) {
                 psError(__func__,"psImageAlloc returned non-NULL parent");
-                psImageFree(image);
+                psFree(image);
                 return 5;
             }
@@ -108,5 +108,5 @@
             if (image->nChildren != 0) {
                 psError(__func__,"psImageAlloc returned non-zero number of children");
-                psImageFree(image);
+                psFree(image);
                 return 6;
             }
@@ -114,5 +114,5 @@
             if (image->children != NULL) {
                 psError(__func__,"psImageAlloc returned non-NULL children vector");
-                psImageFree(image);
+                psFree(image);
                 return 7;
             }
@@ -132,5 +132,5 @@
                             if (image->data.U16[r][c] != 2*c+r) {
                                 psError(__func__,"Could not set all pixels in uint16 image at (%d,%d)",c,r);
-                                psImageFree(image);
+                                psFree(image);
                                 return 8;
                             }
@@ -152,5 +152,5 @@
                             if (fabsf(image->data.F32[r][c] - (2.0f*c+r)) > FLT_EPSILON) {
                                 psError(__func__,"Could not set all pixels in float image at (%d,%d)",c,r);
-                                psImageFree(image);
+                                psFree(image);
                                 return 8;
                             }
@@ -172,5 +172,5 @@
                             if (fabs(image->data.F64[r][c] - (2.0f*c+r)) > DBL_EPSILON) {
                                 psError(__func__,"Could not set all pixels in double image at (%d,%d)",c,r);
-                                psImageFree(image);
+                                psFree(image);
                                 return 8;
                             }
@@ -193,5 +193,5 @@
                                     fabsf(cimagf(image->data.C32[r][c]) - c) > FLT_EPSILON ) {
                                 psError(__func__,"Could not set all pixels in complex image at (%d,%d)",c,r);
-                                psImageFree(image);
+                                psFree(image);
                                 return 8;
                             }
@@ -215,5 +215,5 @@
                                 psError(__func__,"Could not set all pixels in image (type=%d) at (%d,%d)",
                                         type[t],c,r);
-                                psImageFree(image);
+                                psFree(image);
                                 return 8;
                             }
@@ -225,10 +225,10 @@
             // #548: Verify no memory leaks or corruption are detected after a valid psImage structure with no
             // children is freed.
-            psImageFree(image);
+            psFree(image);
         }
     }
 
     // #548: Verify program execution doesn't stop, if the input psImage structure pointer is null.
-    psImageFree(NULL);
+    psFree(NULL);
 
     // #548: Verify no memory leaks or corruption are detected after a valid psImage structure with multiple
@@ -238,5 +238,5 @@
     psImageSubset(NULL,image,50,50,20,20);
 
-    psImageFree(image);
+    psFree(image);
 
     return 0;
@@ -501,5 +501,5 @@
     }
 
-    psImageFree(original);
+    psFree(original);
 
     return 0;
@@ -599,6 +599,6 @@
     }
 
-    psImageFree(img);
-    psImageFree(img2);
+    psFree(img);
+    psFree(img2);
 
     return 0;
@@ -678,5 +678,5 @@
         return 2; \
     } \
-    psImageFree(img);
+    psFree(img);
 
     #define testImageClipByComplexType(datatype) \
@@ -718,5 +718,5 @@
         return 2; \
     } \
-    psImageFree(img);
+    psFree(img);
 
     psLogMsg(__func__,PS_LOG_INFO,"Testing clipping of F64 imagery");
@@ -824,5 +824,5 @@
         return 2; \
     } \
-    psImageFree(img);
+    psFree(img);
 
     testImageClipNaNByType(F32);
@@ -906,6 +906,6 @@
         } \
     } \
-    psImageFree(img); \
-    psImageFree(img2);
+    psFree(img); \
+    psFree(img2);
 
     #define testOverlayType(DATATYPE) \
@@ -1016,6 +1016,6 @@
     }
 
-    psImageFree(img);
-    psImageFree(img2);
+    psFree(img);
+    psFree(img2);
 
     return 0;
Index: /trunk/psLib/test/image/tst_psImageFFT.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageFFT.c	(revision 1072)
+++ /trunk/psLib/test/image/tst_psImageFFT.c	(revision 1073)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-12 19:46:04 $
+ *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -116,7 +116,7 @@
     }
 
-    psImageFree(img);
-    psImageFree(img2);
-    psImageFree(img3);
+    psFree(img);
+    psFree(img2);
+    psFree(img3);
 
     return 0;
@@ -181,7 +181,7 @@
     }
 
-    psImageFree(img);
-    psImageFree(img2);
-    psImageFree(img3);
+    psFree(img);
+    psFree(img2);
+    psFree(img3);
 
     return 0;
@@ -265,7 +265,7 @@
     }
 
-    psImageFree(img);
-    psImageFree(img2);
-    psImageFree(img3);
+    psFree(img);
+    psFree(img2);
+    psFree(img3);
 
     return 0;
@@ -311,6 +311,6 @@
     }
 
-    psImageFree(img);
-    psImageFree(img2);
+    psFree(img);
+    psFree(img2);
 
     return 0;
@@ -359,7 +359,7 @@
     }
 
-    psImageFree(img);
-    psImageFree(img2);
-
-    return 0;
-}
+    psFree(img);
+    psFree(img2);
+
+    return 0;
+}
Index: /trunk/psLib/test/image/tst_psImageIO.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageIO.c	(revision 1072)
+++ /trunk/psLib/test/image/tst_psImageIO.c	(revision 1073)
@@ -6,6 +6,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2004-06-11 19:18:41 $
+ *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2004-06-23 23:00:17 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -107,7 +107,7 @@
             return 4; \
         } \
-        psImageFree(img); \
+        psFree(img); \
         img_ref = img = psImageAlloc(2,2,PS_TYPE_F32); \
-        psImageFree(img3); \
+        psFree(img3); \
         img3 = NULL; \
         img = psImageReadSection(img,readM0,readN0,readM,readN,0,NULL,0,filename); \
@@ -139,7 +139,7 @@
             } \
         } \
-        psImageFree(img); \
+        psFree(img); \
         img = NULL; \
-        psImageFree(img3); \
+        psFree(img3); \
         img3 = NULL; \
         img3 = psImageReadSection(img3,readM0,readN0,readM,readN,0,NULL,1,filename); \
@@ -167,8 +167,8 @@
             } \
         } \
-        psImageFree(img); \
-        psImageFree(img2); \
-        psImageFree(img3); \
-        psImageFree(img4); \
+        psFree(img); \
+        psFree(img2); \
+        psFree(img3); \
+        psFree(img4); \
     }
 
@@ -302,6 +302,6 @@
         return 15;
     }
-    psImageFree(img);
-    psImageFree(img2);
+    psFree(img);
+    psFree(img2);
 
     // Did it really overwrite the pixel values?  Let's read it in and see.
@@ -322,5 +322,5 @@
     }
 
-    psImageFree(img);
+    psFree(img);
 
     return 0;
Index: /trunk/psLib/test/image/tst_psImageStats00.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageStats00.c	(revision 1072)
+++ /trunk/psLib/test/image/tst_psImageStats00.c	(revision 1073)
@@ -96,5 +96,5 @@
                    myHist->nums->data.S32[i]);
         }
-        psHistogramFree(myHist);
+        psFree(myHist);
 
         psMemCheckCorruption(1);
@@ -133,7 +133,7 @@
                                 "psImageStats functions",
                                 "Deallocate the psHistogram/psImage structure.");
-        psHistogramFree(myHist);
-        psImageFree(tmpImage);
-        psImageFree(tmpMask);
+        psFree(myHist);
+        psFree(tmpImage);
+        psFree(tmpMask);
 
         psMemCheckCorruption(1);
@@ -167,6 +167,6 @@
 
     psMemCheckCorruption(1);
-    psHistogramFree(myHist);
-    psImageFree(tmpImage);
+    psFree(myHist);
+    psFree(tmpImage);
     psMemCheckCorruption(1);
     memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
Index: /trunk/psLib/test/image/tst_psImageStats01.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageStats01.c	(revision 1072)
+++ /trunk/psLib/test/image/tst_psImageStats01.c	(revision 1073)
@@ -123,7 +123,7 @@
                                 "psImageStats functions",
                                 "Deallocate the psStats/psImage structure.");
-        psStatsFree(myStats);
-        psImageFree(tmpImage);
-        psImageFree(tmpMask);
+        psFree(myStats);
+        psFree(tmpImage);
+        psFree(tmpMask);
 
         psMemCheckCorruption(1);
@@ -165,7 +165,7 @@
     //
 
-    psStatsFree(myStats);
-    psImageFree(tmpImage);
-    psImageFree(tmpMask);
+    psFree(myStats);
+    psFree(tmpImage);
+    psFree(tmpMask);
 
     psMemCheckCorruption(1);
Index: /trunk/psLib/test/image/tst_psImageStats02.c
===================================================================
--- /trunk/psLib/test/image/tst_psImageStats02.c	(revision 1072)
+++ /trunk/psLib/test/image/tst_psImageStats02.c	(revision 1073)
@@ -102,8 +102,8 @@
                             "psImageStats functions",
                             "Deallocate the psStats/psImage structure.");
-    psStatsFree(myStats);
-    psImageFree(tmpImage);
-    psImageFree(outImage);
-    psPolynomial2DFree(my2DPoly);
+    psFree(myStats);
+    psFree(tmpImage);
+    psFree(outImage);
+    psFree(my2DPoly);
 
     psMemCheckCorruption(1);
Index: /trunk/psLib/test/image/verified/tst_psImageStats02.stdout
===================================================================
--- /trunk/psLib/test/image/verified/tst_psImageStats02.stdout	(revision 1072)
+++ /trunk/psLib/test/image/verified/tst_psImageStats02.stdout	(revision 1073)
@@ -5,4 +5,22 @@
 \**********************************************************************************/
 
+SUM(Cheby(0) * Cheby(0)) is 3.000000
+SUM(Cheby(0) * Cheby(1)) is -0.000000
+SUM(Cheby(0) * Cheby(2)) is 0.000000
+SUM(Cheby(1) * Cheby(0)) is -0.000000
+SUM(Cheby(1) * Cheby(1)) is 1.500000
+SUM(Cheby(1) * Cheby(2)) is 0.000000
+SUM(Cheby(2) * Cheby(0)) is 0.000000
+SUM(Cheby(2) * Cheby(1)) is 0.000000
+SUM(Cheby(2) * Cheby(2)) is 1.500000
+Cheby Polynomial (0, 0) coefficient is 6.000000
+Cheby Polynomial (0, 1) coefficient is 1.154701
+Cheby Polynomial (0, 2) coefficient is 0.000000
+Cheby Polynomial (1, 0) coefficient is 5.773502
+Cheby Polynomial (1, 1) coefficient is -0.000000
+Cheby Polynomial (1, 2) coefficient is -0.000000
+Cheby Polynomial (2, 0) coefficient is 0.000000
+Cheby Polynomial (2, 1) coefficient is 0.000000
+Cheby Polynomial (2, 2) coefficient is 0.000000
 
 ---> TESTPOINT PASSED (psImageStats functions{Calculate Chebyshev Polynomials, no mask} | tst_psImageStats02.c)
Index: /trunk/psLib/test/sysUtils/builddir/atst_psAbort_01.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/atst_psAbort_01.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/atst_psAbort_01.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/atst_psAbort_02.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/atst_psAbort_02.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/atst_psAbort_02.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/atst_psAbort_03.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/atst_psAbort_03.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/atst_psAbort_03.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/tst_psError.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/tst_psError.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/tst_psError.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/tst_psHash00.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/tst_psHash00.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/tst_psHash00.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/tst_psHash01.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/tst_psHash01.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/tst_psHash01.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/tst_psHash02.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/tst_psHash02.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/tst_psHash02.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/tst_psHash03.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/tst_psHash03.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/tst_psHash03.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/tst_psHash04.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/tst_psHash04.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/tst_psHash04.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/tst_psLogMsg00.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/tst_psLogMsg00.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/tst_psLogMsg00.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/tst_psLogMsg01.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/tst_psLogMsg01.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/tst_psLogMsg01.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/tst_psLogMsg02.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/tst_psLogMsg02.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/tst_psLogMsg02.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/tst_psLogMsg03.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/tst_psLogMsg03.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/tst_psLogMsg03.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/tst_psMemory.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/tst_psMemory.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/tst_psMemory.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h
Index: /trunk/psLib/test/sysUtils/builddir/tst_psStringCopy.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/tst_psStringCopy.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/tst_psStringCopy.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/tst_psTrace00.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/tst_psTrace00.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/tst_psTrace00.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/tst_psTrace01.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/tst_psTrace01.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/tst_psTrace01.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/tst_psTrace02.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/tst_psTrace02.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/tst_psTrace02.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/tst_psTrace03.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/tst_psTrace03.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/tst_psTrace03.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/builddir/tst_psTrace04.d
===================================================================
--- /trunk/psLib/test/sysUtils/builddir/tst_psTrace04.d	(revision 1072)
+++ /trunk/psLib/test/sysUtils/builddir/tst_psTrace04.d	(revision 1073)
@@ -3,6 +3,7 @@
   ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
   ../../include/psString.h ../../include/psType.h ../../include/psList.h \
-  ../../include/psVector.h ../../include/psHash.h ../../include/psImage.h \
+  ../../include/psVector.h ../../include/psHash.h \
+  ../../include/psScalar.h ../../include/psImage.h \
   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
-  ../../include/psMatrix.h ../../include/psFFT.h \
-  ../../include/psImageIO.h ../../include/psTest.h
+  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
+  ../../include/psFFT.h ../../include/psImageIO.h ../../include/psTest.h
Index: /trunk/psLib/test/sysUtils/tst_psHash00.c
===================================================================
--- /trunk/psLib/test/sysUtils/tst_psHash00.c	(revision 1072)
+++ /trunk/psLib/test/sysUtils/tst_psHash00.c	(revision 1073)
@@ -53,7 +53,7 @@
                 testStatus);
 
-    psHashFree(myHashTable, NULL);
+    psFree(myHashTable);
 
-    memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
+    memLeaks = psMemCheckLeaks(currentId,NULL,stderr);
     if (0 != memLeaks) {
         psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
Index: /trunk/psLib/test/sysUtils/tst_psHash01.c
===================================================================
--- /trunk/psLib/test/sysUtils/tst_psHash01.c	(revision 1072)
+++ /trunk/psLib/test/sysUtils/tst_psHash01.c	(revision 1073)
@@ -14,7 +14,11 @@
 }
 ID;
+
+static void IdFree(ID *id);
+
 static ID *IdAlloc(const char *name)
 {
     ID *id = psAlloc(sizeof(ID));
+    p_psMemSetDeallocator(id,(psFreeFcn)IdFree);
     id->name = psStringCopy(name);
 
@@ -26,5 +30,4 @@
     imGlobal++;
     psFree(id->name);
-    psFree(id);
 }
 
@@ -34,4 +37,5 @@
     int testStatus      = true;
     int currentId = psMemGetId();
+    ID* id = NULL;
     int memLeaks        = 0;
 
@@ -41,13 +45,17 @@
 
     myHashTable = psHashAlloc(NUM_HASH_TABLE_BUCKETS);
-    psHashInsert(myHashTable, "ENTRY00", IdAlloc("IDA"),
-                 (void (*)(void *))IdFree);
-    psHashInsert(myHashTable, "ENTRY01", IdAlloc("IDB"),
-                 (void (*)(void *))IdFree);
-    psHashInsert(myHashTable, "ENTRY02", IdAlloc("IDC"),
-                 (void (*)(void *))IdFree);
-    psHashInsert(myHashTable, "ENTRY03", IdAlloc("IDD"),
-                 (void (*)(void *))IdFree);
-    psHashFree(myHashTable, (void (*)(void *))IdFree);
+    id = IdAlloc("IDA");
+    psHashInsert(myHashTable, "ENTRY00", id);
+    psFree(id);
+    id = IdAlloc("IDB");
+    psHashInsert(myHashTable, "ENTRY01", id);
+    psFree(id);
+    id = IdAlloc("IDC");
+    psHashInsert(myHashTable, "ENTRY02", id);
+    psFree(id);
+    id = IdAlloc("IDD");
+    psHashInsert(myHashTable, "ENTRY03", id);
+    psFree(id);
+    psFree(myHashTable);
 
     if (imGlobal != 4) {
Index: /trunk/psLib/test/sysUtils/tst_psHash02.c
===================================================================
--- /trunk/psLib/test/sysUtils/tst_psHash02.c	(revision 1072)
+++ /trunk/psLib/test/sysUtils/tst_psHash02.c	(revision 1073)
@@ -19,7 +19,10 @@
 }
 ID;
+static void IdFree(ID *id);
+
 static ID *IdAlloc(const char *name)
 {
     ID *id = psAlloc(sizeof(ID));
+    p_psMemSetDeallocator(id,(psFreeFcn)IdFree);
     id->name = psStringCopy(name);
 
@@ -31,5 +34,4 @@
     imGlobal++;
     psFree(id->name);
-    psFree(id);
 }
 
@@ -52,6 +54,7 @@
     i = 0;
     while (myKeys[i] != NULL) {
-        psHashInsert(myHashTable, myKeys[i], IdAlloc(myData[i]),
-                     (void (*)(void *))IdFree);
+        id = IdAlloc(myData[i]);
+        psHashInsert(myHashTable, myKeys[i], id);
+        psFree(id);
         i++;
     }
@@ -78,5 +81,5 @@
 
     //    psHashFree(myHashTable, NULL);
-    psHashFree(myHashTable, (void (*)(void *))IdFree);
+    psFree(myHashTable);
 
     memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
Index: /trunk/psLib/test/sysUtils/tst_psHash03.c
===================================================================
--- /trunk/psLib/test/sysUtils/tst_psHash03.c	(revision 1072)
+++ /trunk/psLib/test/sysUtils/tst_psHash03.c	(revision 1073)
@@ -19,4 +19,5 @@
 }
 ID;
+static void IdFree(ID *id);
 
 // NOTE: This is my own little routine I used in debugging a memory
@@ -48,4 +49,5 @@
 
     id = psAlloc(sizeof(ID));
+    p_psMemSetDeallocator(id,(psFreeFcn)IdFree);
 
     id->name = psStringCopy(name);
@@ -58,5 +60,4 @@
     imGlobal++;
     psFree(id->name);
-    psFree(id);
 }
 
@@ -82,6 +83,5 @@
     i = 0;
     while (myKeys[i] != NULL) {
-        psHashInsert(myHashTable, myKeys[i], IdAlloc(myData[i]),
-                     (void (*)(void *))IdFree);
+        psHashInsert(myHashTable, myKeys[i], IdAlloc(myData[i]));
         i++;
     }
@@ -101,9 +101,9 @@
     i = 0;
     while (myKeys[i] != NULL) {
-        id = psHashRemove(myHashTable, myKeys[i], (void (*)(void *))IdFree);
+        id = psHashRemove(myHashTable, myKeys[i]);
         // The psHashRemove() procedure removes the entry from the hash
         // table, but does not delete the data.  The following is necessary
         // to delete the data as well (which is returned from the call).
-        IdFree(id);
+        psFree(id);
         id = psHashLookup(myHashTable, myKeys[i]);
         if (id != NULL) {
@@ -119,6 +119,6 @@
                 testStatus);
 
-    psHashFree(myHashTable, (void (*)(void *))IdFree);
-    memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
+    psFree(myHashTable);
+    memLeaks = psMemCheckLeaks(currentId,NULL,stdout);
     if (0 != memLeaks) {
         psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
Index: /trunk/psLib/test/sysUtils/tst_psHash04.c
===================================================================
--- /trunk/psLib/test/sysUtils/tst_psHash04.c	(revision 1072)
+++ /trunk/psLib/test/sysUtils/tst_psHash04.c	(revision 1073)
@@ -14,7 +14,11 @@
 }
 ID;
+static void IdFree(ID *id);
+
 static ID *IdAlloc(const char *name)
 {
     ID *id = psAlloc(sizeof(ID));
+    p_psMemSetDeallocator(id,(psFreeFcn)IdFree);
+
     id->name = psStringCopy(name);
 
@@ -26,5 +30,4 @@
     imGlobal++;
     psFree(id->name);
-    psFree(id);
 }
 
@@ -40,4 +43,5 @@
     psList *myLinkList = NULL;
     psListElem *tmp = NULL;
+    ID* id = NULL;
 
     printPositiveTestHeader(stdout,
@@ -48,6 +52,7 @@
     i = 0;
     while (myKeys[i] != NULL) {
-        psHashInsert(myHashTable, myKeys[i], IdAlloc(myData[i]),
-                     (void (*)(void *))IdFree);
+        id = IdAlloc(myData[i]);
+        psHashInsert(myHashTable, myKeys[i], id);
+        psFree(id);
         i++;
     }
@@ -59,5 +64,5 @@
     }
 
-    psListFree(myLinkList, NULL);
+    psFree(myLinkList);
 
     printFooter(stdout,
@@ -66,7 +71,7 @@
                 testStatus);
 
-    psHashFree(myHashTable, (void (*)(void *))IdFree);
+    psFree(myHashTable);
 
-    memLeaks = psMemCheckLeaks(currentId,NULL,NULL);
+    memLeaks = psMemCheckLeaks(currentId,NULL,stderr);
     if (0 != memLeaks) {
         psAbort(__func__,"Memory Leaks! (%d leaks)", memLeaks);
Index: /trunk/psLib/test/sysUtils/verified/tst_psMemory.stderr
===================================================================
--- /trunk/psLib/test/sysUtils/verified/tst_psMemory.stderr	(revision 1072)
+++ /trunk/psLib/test/sysUtils/verified/tst_psMemory.stderr	(revision 1073)
@@ -81,5 +81,5 @@
  <DATE> <TIME> <HOST> |I|TPmemCorruption|psMemCheckCorruption should output an error message and memProblemCallback callback should be called.
  <DATE> <TIME> <HOST> |E|psMemCheckCorru|psMemCheckCorruption: memory block 1 is corrupted (buffer underflow)
- <DATE> <TIME> <HOST> |I|memProblemCallb|memory callback called for id 1 (psMemCheckCorruption:228).
+ <DATE> <TIME> <HOST> |I|memProblemCallb|memory callback called for id 1 (psMemCheckCorruption:226).
 
 ---> TESTPOINT PASSED (psMemory{455-TPmemCorruption} | tst_psMemory.c)
