Index: trunk/psLib/src/sys/psMemory.h
===================================================================
--- trunk/psLib/src/sys/psMemory.h	(revision 978)
+++ 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);
 
 /*
