Index: /trunk/psLib/src/sys/psMemory.c
===================================================================
--- /trunk/psLib/src/sys/psMemory.c	(revision 7413)
+++ /trunk/psLib/src/sys/psMemory.c	(revision 7414)
@@ -8,6 +8,6 @@
 *  @author Robert Lupton, Princeton University
 *
-*  @version $Revision: 1.71 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-05-18 01:22:48 $
+*  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-06-07 23:16:44 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -61,4 +61,7 @@
 static bool safeThreads = true;
 
+// private boolean for deciding if allocated memory is persistent
+static bool memory_is_persistent = false;
+
 static psS32 recycleBins = 13;
 static psS32 recycleBinSize[14] = {
@@ -330,4 +333,18 @@
 }
 
+/*
+ * Set whether allocated memory is persistent
+ */
+bool p_psMemAllocatePersistent(bool is_persistent)
+{
+    const bool old = memory_is_persistent;
+    memory_is_persistent = is_persistent;
+
+    return old;
+}
+
+/*
+ * Actually allocate memory
+ */
 psPtr p_psAlloc(size_t size,
                 const char *file,
@@ -398,5 +415,5 @@
     ptr->file = file;
     ptr->freeFunc = NULL;
-    ptr->persistent = false;
+    ptr->persistent = memory_is_persistent;
     *(psU32 *)&ptr->lineno = lineno;
     *(psPtr *)((int8_t *) (ptr + 1) + size) = P_PS_MEMMAGIC;
Index: /trunk/psLib/src/sys/psMemory.h
===================================================================
--- /trunk/psLib/src/sys/psMemory.h	(revision 7413)
+++ /trunk/psLib/src/sys/psMemory.h	(revision 7414)
@@ -12,6 +12,6 @@
  *  @ingroup MemoryManagement
  *
- *  @version $Revision: 1.54 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-05-18 01:22:48 $
+ *  @version $Revision: 1.55 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-07 23:16:44 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -209,4 +209,12 @@
 );
 
+/** Set whether allocated memory is persistent
+ *
+ *  Set whether allocated memory is persistent. The defeault is false.
+ *
+ *  @return bool:       The previous value of whether all allocated memory is persistent
+ */
+bool p_psMemAllocatePersistent(bool is_persistent); ///< Should all memory allocated be persistent?
+
 /** Get the memory's persistent flag.
  *
