Index: trunk/psLib/src/sys/psMemory.c
===================================================================
--- trunk/psLib/src/sys/psMemory.c	(revision 32708)
+++ trunk/psLib/src/sys/psMemory.c	(revision 32713)
@@ -384,5 +384,5 @@
 // pointer to the last mem block that was allocated.
 // This is the root of the entire memory list
-static psMemBlock *lastMemBlockAllocated = NULL;
+static volatile psMemBlock *lastMemBlockAllocated = NULL;
 
 // set lock on lastMemBlockAllocated
@@ -655,6 +655,7 @@
     memBlock->refCounter = 1;                   // one user so far
 
-    psMemBlock *last0 = lastMemBlockAllocated;
-    int flight0 = (lastMemBlockAllocated) ? lastMemBlockAllocated->inFlight : 10;
+    // XXX these lines are test lines that potentially access invalid memory
+    // XXX psMemBlock *last0 = lastMemBlockAllocated;
+    // XXX int flight0 = (lastMemBlockAllocated) ? lastMemBlockAllocated->inFlight : 10;
 
     // need exclusive access of the memory block list now...
@@ -663,10 +664,10 @@
     BLOCKLAST_LOCK ();
 
-    psMemBlock *last1 = lastMemBlockAllocated;
-    int flight1 = (lastMemBlockAllocated) ? lastMemBlockAllocated->inFlight : 10;
-
-    if (false) {
-	fprintf (stderr, "last 0 : %lld, last 1 : %lld, flight0: %d, flight1: %d\n", (long long int) last0, (long long int) last1, (int) flight0, (int) flight1);
-    }
+    // XXX psMemBlock *last1 = lastMemBlockAllocated;
+    // XXX int flight1 = (lastMemBlockAllocated) ? lastMemBlockAllocated->inFlight : 10;
+
+    // XXX if (false) {
+    // XXX 	fprintf (stderr, "last 0 : %lld, last 1 : %lld, flight0: %d, flight1: %d\n", (long long int) last0, (long long int) last1, (int) flight0, (int) flight1);
+    // XXX }
 
     // increment the memory id only after we've grabbed the memBlockListMutex this value is
