Index: trunk/psLib/src/sys/psMemory.c
===================================================================
--- trunk/psLib/src/sys/psMemory.c	(revision 11672)
+++ trunk/psLib/src/sys/psMemory.c	(revision 11674)
@@ -10,6 +10,6 @@
 *  @author Joshua Hoblitt, University of Hawaii
 *
-*  @version $Revision: 1.93 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2007-02-07 00:36:02 $
+*  @version $Revision: 1.94 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2007-02-07 01:15:49 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -355,9 +355,9 @@
 }
 
-int p_psMemCheckCorruption(FILE *output,
-                           bool abort_on_error,
-                           const char *file,
+int p_psMemCheckCorruption(const char *file,
                            unsigned int lineno,
-                           const char *func)
+                           const char *func,
+                           FILE *output,
+                           bool abort_on_error)
 {
     // get exclusive access to the memBlock list to avoid it changing on us
@@ -385,4 +385,5 @@
 }
 
+
 /*
  * Set whether allocated memory is persistent
@@ -400,11 +401,12 @@
 }
 
+
 /*
  * Actually allocate memory
  */
-void *p_psAlloc(size_t size,
-                const char *file,
+void *p_psAlloc(const char *file,
                 unsigned int lineno,
-                const char *func)
+                const char *func,
+                size_t size)
 {
 
@@ -490,12 +492,13 @@
 }
 
-void *p_psRealloc(void *ptr,
-                  size_t size,
-                  const char *file,
+
+void *p_psRealloc(const char *file,
                   unsigned int lineno,
-                  const char *func)
+                  const char *func,
+                  void *ptr,
+                  size_t size)
 {
     if (ptr == NULL) {
-        return p_psAlloc(size, file, lineno, func);
+        return p_psAlloc(file, lineno, func, size);
     }
 
@@ -565,11 +568,11 @@
  * Check for memory leaks.
  */
-int p_psMemCheckLeaks(psMemId id0,
+int p_psMemCheckLeaks(const char *file,
+                      unsigned int lineno,
+                      const char *func,
+                      psMemId id0,
                       psMemBlock ***array,
                       FILE * fd,
-                      bool persistence,
-                      const char *file,
-                      unsigned int lineno,
-                      const char *func)
+                      bool persistence)
 {
     psS32 nleak = 0;
@@ -579,5 +582,5 @@
     // make sure that the memblock list is free of corruption before we crawl
     // the list
-    p_psMemCheckCorruption(fd, true, file, lineno, func);
+    p_psMemCheckCorruption(file, lineno, func, fd, true);
 
     MUTEX_LOCK(&memBlockListMutex);
@@ -675,13 +678,12 @@
 }
 
+
 /*
  * Reference counting APIs
  */
-
-// return refCounter
-psReferenceCount p_psMemGetRefCounter(void *ptr,
-                                      const char *file,
+psReferenceCount p_psMemGetRefCounter(const char *file,
                                       unsigned int lineno,
-                                      const char *func)
+                                      const char *func,
+                                      void *ptr)
 {
     if (ptr == NULL) {
@@ -696,9 +698,10 @@
 }
 
+
 // increment and return refCounter
-void *p_psMemIncrRefCounter(void *ptr,
-                            const char *file,
+void *p_psMemIncrRefCounter(const char *file,
                             unsigned int lineno,
-                            const char *func)
+                            const char *func,
+                            void *ptr)
 {
     if (ptr == NULL) {
@@ -721,4 +724,5 @@
     return ptr;
 }
+
 
 #if 0
@@ -755,9 +759,10 @@
 #endif
 
+
 // decrement and return refCounter
-void *p_psMemDecrRefCounter(void * ptr,
-                            const char *file,
+void *p_psMemDecrRefCounter(const char *file,
                             unsigned int lineno,
-                            const char *func)
+                            const char *func,
+                            void * ptr)
 {
     if (ptr == NULL) {
@@ -823,9 +828,10 @@
 }
 
-void p_psMemSetDeallocator(void *ptr,
-                           psFreeFunc freeFunc,
-                           const char *file,
+
+void p_psMemSetDeallocator(const char *file,
                            unsigned int lineno,
-                           const char *func)
+                           const char *func,
+                           void *ptr,
+                           psFreeFunc freeFunc)
 {
     if (ptr == NULL) {
@@ -840,8 +846,9 @@
 }
 
-psFreeFunc p_psMemGetDeallocator(void *ptr,
-                                 const char *file,
+
+psFreeFunc p_psMemGetDeallocator(const char *file,
                                  unsigned int lineno,
-                                 const char *func)
+                                 const char *func,
+                                 void *ptr)
 {
     if (ptr == NULL) {
@@ -856,4 +863,5 @@
 }
 
+
 bool psMemSetThreadSafety(bool safe)
 {
@@ -868,4 +876,5 @@
 }
 
+
 bool psMemGetThreadSafety(void)
 {
@@ -879,8 +888,9 @@
 }
 
-bool p_psMemGetPersistent(void *ptr,
-                          const char *file,
+
+bool p_psMemGetPersistent(const char *file,
                           unsigned int lineno,
-                          const char *func)
+                          const char *func,
+                          void *ptr)
 {
     if (ptr == NULL) {
@@ -895,9 +905,10 @@
 }
 
-void p_psMemSetPersistent(void *ptr,
-                          bool value,
-                          const char *file,
+
+void p_psMemSetPersistent(const char *file,
                           unsigned int lineno,
-                          const char *func)
+                          const char *func,
+                          void *ptr,
+                          bool value)
 {
     if (ptr == NULL) {
@@ -912,11 +923,12 @@
 }
 
-/************************************************************************************************************/
-/*
- * Return the total amount of memory owned by psLib; if non-NULL also provide a breakdown
- * into recyclable, allocated, and allocated-and-persistent
+
+/******************************************************************************/
+/*
+ * Return the total amount of memory owned by psLib; if non-NULL also provide a
+ * breakdown into recyclable, allocated, and allocated-and-persistent
  *
- * It would be simple enough to fix this code to return an array of structs to describe
- * the insides of the allocator rather than the printf used here.
+ * It would be simple enough to fix this code to return an array of structs to
+ * describe the insides of the allocator rather than the printf used here.
  */
 size_t psMemStats(const bool print, // print details as they're found?
