Index: trunk/psLib/src/sys/psAssert.h
===================================================================
--- trunk/psLib/src/sys/psAssert.h	(revision 9509)
+++ trunk/psLib/src/sys/psAssert.h	(revision 9538)
@@ -6,6 +6,20 @@
 #include <math.h>
 
+#include "psMemory.h"
 #include "psError.h"
 #include "psLogMsg.h"
+
+// Ensure this is a psLib pointer, by checking for the memblock bounds.
+#define PS_ASSERT_PTR(NAME, RVAL) \
+{ \
+    psMemBlock *mb = (psMemBlock*)(NAME) - 1; \
+    if (mb->startblock != P_PS_MEMMAGIC || mb->endblock != P_PS_MEMMAGIC || \
+            *(psPtr *)((int8_t *) (mb + 1) + mb->userMemorySize) != P_PS_MEMMAGIC) { \
+        psError(PS_ERR_MEMORY_CORRUPTION, false, \
+                "Error: Pointer %s is corrupted or not on the PS memory system.", \
+                #NAME); \
+        return (RVAL); \
+    } \
+}
 
 #define PS_ASSERT_INT_UNEQUAL(NAME1, NAME2, RVAL) \
Index: trunk/psLib/src/sys/psConfigure.c
===================================================================
--- trunk/psLib/src/sys/psConfigure.c	(revision 9509)
+++ trunk/psLib/src/sys/psConfigure.c	(revision 9538)
@@ -13,6 +13,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-08-26 04:34:28 $
+ *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-13 21:13:48 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -34,5 +34,5 @@
 static FILE *memCheckFile = NULL;       // File to which to write results of mem check
 
-char* psLibVersion(void)
+psString psLibVersion(void)
 {
     char version[80];
Index: trunk/psLib/src/sys/psConfigure.h
===================================================================
--- trunk/psLib/src/sys/psConfigure.h	(revision 9509)
+++ trunk/psLib/src/sys/psConfigure.h	(revision 9538)
@@ -13,6 +13,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-06-23 01:59:15 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-13 21:13:48 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -32,5 +32,5 @@
  *  @return char*: String with version name.
  */
-char* psLibVersion(
+psString psLibVersion(
     void
 );
Index: trunk/psLib/src/sys/psLine.c
===================================================================
--- trunk/psLib/src/sys/psLine.c	(revision 9509)
+++ trunk/psLib/src/sys/psLine.c	(revision 9538)
@@ -3,4 +3,5 @@
 
 #include "psMemory.h"
+#include "psAssert.h"
 #include "psConstants.h"
 #include "psLine.h"
@@ -64,7 +65,5 @@
 bool psMemCheckLine(psPtr ptr)
 {
-    if (!is_psType(ptr)) {
-        return false;
-    }
+    PS_ASSERT_PTR(ptr, false);
     return ( psMemGetDeallocator(ptr) == (psFreeFunc)lineFree );
 }
Index: trunk/psLib/src/sys/psMemory.c
===================================================================
--- trunk/psLib/src/sys/psMemory.c	(revision 9509)
+++ trunk/psLib/src/sys/psMemory.c	(revision 9538)
@@ -8,6 +8,6 @@
 *  @author Robert Lupton, Princeton University
 *
-*  @version $Revision: 1.85 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-09-14 22:27:29 $
+*  @version $Revision: 1.86 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-10-13 21:13:48 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -24,4 +24,5 @@
 #include "psMemory.h"
 #include "psError.h"
+#include "psAssert.h"
 #include "psAbort.h"
 #include "psLogMsg.h"
@@ -35,6 +36,4 @@
 #include "psLine.h"
 #include "psRegion.h"
-
-#define P_PS_MEMMAGIC (psPtr )0xdeadbeef   // Magic number in psMemBlock header
 
 #define P_PS_LARGE_BLOCK_SIZE 65536        // size where under, we try to recycle
@@ -274,17 +273,5 @@
 psMemId psMemGetId(void)
 {
-    psMemId id;
-
-    if (safeThreads) {
-        pthread_mutex_lock(&memIdMutex);
-    }
-
-    id = memid + 1;
-
-    if (safeThreads) {
-        pthread_mutex_unlock(&memIdMutex);
-    }
-
-    return id;
+    return psMemGetLastId() + 1;
 }
 
@@ -889,23 +876,8 @@
 }
 
-bool is_psType(psPtr ptr)
-{
-    if (ptr == NULL) {
-        return false;
-    }
-    psMemBlock* m = ((psMemBlock* ) ptr) - 1;
-    if (m->startblock != P_PS_MEMMAGIC || m->endblock != P_PS_MEMMAGIC) {
-        return false; //Probably not a psAllocated-Type
-    } else {
-        return true;
-    }
-}
-
 bool psMemCheckType(psDataType type,
                     psPtr ptr)
 {
-    if (!is_psType(ptr)) {
-        return false;
-    }
+    PS_ASSERT_PTR(ptr, false);
 
     switch(type) {
Index: trunk/psLib/src/sys/psMemory.h
===================================================================
--- trunk/psLib/src/sys/psMemory.h	(revision 9509)
+++ trunk/psLib/src/sys/psMemory.h	(revision 9538)
@@ -12,6 +12,6 @@
  *  @ingroup MemoryManagement
  *
- *  @version $Revision: 1.60 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-08-30 04:40:56 $
+ *  @version $Revision: 1.61 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-13 21:13:48 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -29,4 +29,6 @@
  *  @{
  */
+
+#define P_PS_MEMMAGIC (psPtr)0xdeadbeef   // Magic number in psMemBlock header
 
 /**
@@ -172,12 +174,4 @@
 );
 
-/** Tells whether or not a pointer has been allocated as a psDataType.
- *
- * @return bool:        True if ptr is a psDataType, otherwise false.
- */
-bool is_psType(
-    psPtr ptr                          ///< The pointer whose type to check
-);
-
 /** Checks the deallocator to see if the pointer matches the desired datatype.
  *
Index: trunk/psLib/src/sys/psSlurp.c
===================================================================
--- trunk/psLib/src/sys/psSlurp.c	(revision 9509)
+++ trunk/psLib/src/sys/psSlurp.c	(revision 9538)
@@ -5,6 +5,6 @@
  *  @author Joshua Hoblitt, University of Hawaii
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-27 03:50:19 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-13 21:13:48 $
  *
  *  Copyright 2006 University of Hawaii
@@ -15,4 +15,5 @@
 #endif
 
+#include <stdio.h>
 #include <unistd.h>
 
Index: trunk/psLib/src/sys/psSlurp.h
===================================================================
--- trunk/psLib/src/sys/psSlurp.h	(revision 9509)
+++ trunk/psLib/src/sys/psSlurp.h	(revision 9538)
@@ -1,5 +1,19 @@
+#ifndef PS_SLURP_H
+#define PS_SLURP_H
+
 #include <stdio.h>
-#include <pslib.h>
+#include "psString.h"
 
-psString psSlurpFD(int fd);
-psString psSlurpFile(FILE *stream);
+
+// Read ("slurp") a file (specified by file descriptor)
+// and return a string containing the entire file.
+psString psSlurpFD(int fd               // File descriptor to read
+                  );
+
+// Read ("slurp") a file (specified by file stream)
+// and return a string containing the entire file.
+psString psSlurpFile(FILE *stream       // File stream to read
+                    );
+
+
+#endif
Index: trunk/psLib/src/sys/psString.c
===================================================================
--- trunk/psLib/src/sys/psString.c	(revision 9509)
+++ trunk/psLib/src/sys/psString.c	(revision 9538)
@@ -13,6 +13,6 @@
  *  @author David Robbins, MHPCC
  *
- *  @version $Revision: 1.44 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-10-12 21:31:47 $
+ *  @version $Revision: 1.45 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-13 21:13:48 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -47,7 +47,5 @@
 bool psMemCheckString(psPtr ptr)
 {
-    if (!is_psType(ptr)) {
-        return false;
-    }
+    PS_ASSERT_PTR(ptr, false);
     return ( psMemGetDeallocator(ptr) == (psFreeFunc)stringFree );
 }
