Index: /trunk/Ohana/src/libohana/src/ohana_allocate.c
===================================================================
--- /trunk/Ohana/src/libohana/src/ohana_allocate.c	(revision 5343)
+++ /trunk/Ohana/src/libohana/src/ohana_allocate.c	(revision 5344)
@@ -189,5 +189,5 @@
 void ohana_memcheck_func (int allmemory) {
 
-  int i, header;
+  int i, j, next, prev, header;
   size_t *marker;
   char top, bottom;
@@ -211,8 +211,29 @@
     if ((top == 'N') && (bottom == 'N')) continue;
     if (!header) {
-      fprintf (stderr, "         Nmem bot top file            line\n");
+      fprintf (stderr, "         Nmem start end file            line\n");
       header = TRUE;
     }
-    fprintf (stderr, "corrupt:  %3d  %c   %c  %-15s %3d\n", i, bottom, top, memlist[i].file, memlist[i].line);
+      fprintf (stderr, "corrupt:  %3d   %c    %c  %-15s %3d\n", i, bottom, top, memlist[i].file, memlist[i].line);
+    prev = next = -1;
+    for (j = 0; j < Nmemlist; j++) {
+      if (memlist[j].ptr < memlist[i].ptr) {
+	if (prev == -1) prev = j;
+	if (memlist[j].ptr > memlist[prev].ptr) prev = j;
+      }
+      if (memlist[j].ptr > memlist[i].ptr) {
+	if (next == -1) next = j;
+	if (memlist[j].ptr < memlist[next].ptr) next = j;
+      }
+    }	  
+    if (prev == -1) {
+      fprintf (stderr, "no previous memory block\n");
+    } else {
+      fprintf (stderr, "prev:     %3d           %-15s %3d\n", prev, memlist[prev].file, memlist[prev].line);
+    }
+    if (next == -1) {
+      fprintf (stderr, "no next memory block\n");
+    } else {
+      fprintf (stderr, "next:     %3d           %-15s %3d\n", next, memlist[next].file, memlist[next].line);
+    }
     abort ();
   }
