Index: /trunk/Ohana/src/libohana/src/ohana_allocate.c
===================================================================
--- /trunk/Ohana/src/libohana/src/ohana_allocate.c	(revision 4717)
+++ /trunk/Ohana/src/libohana/src/ohana_allocate.c	(revision 4718)
@@ -11,10 +11,10 @@
   if (X == NULL) { \
     fprintf(stderr,"failed malloc at %d in %s\n", __LINE__, __FILE__);\
-    exit (10); } 
+    abort(); } 
 # define OHANA_REALLOCATE(X,T,S) \
   X = (T *) realloc(X,(unsigned)(MAX(((S)*((int)sizeof(T))),1))); \
   if (X == NULL) { \
     fprintf(stderr,"failed realloc at %d in %s\n", __LINE__, __FILE__);\
-    exit (10); }
+    abort(); }
 # define OHANA_CHECK_REALLOCATE(X,T,S,N,D) \
   if ((N) >= (S)) { \
@@ -23,5 +23,5 @@
     if (X == NULL) { \
       fprintf(stderr,"failed realloc increment at %d in %s\n", __LINE__, __FILE__);\
-      exit (10); } }
+      abort(); } }
 # define OHANA_FREE(X) free(X)
 
@@ -42,4 +42,5 @@
 int Nmemlist = 0;
 int NMEMLIST = 0;
+int NMEMBYTE = 0;
 
 void ohana_meminit () {
@@ -47,4 +48,5 @@
   NMEMLIST = 1000;
   OHANA_ALLOCATE (memlist, Memlist, NMEMLIST);
+  NMEMBYTE = sizeof(size_t);
 }
 
@@ -55,5 +57,5 @@
   vfprintf (stderr, format, argp);
   va_end (argp);
-  exit (5);
+  abort();
 }
 
@@ -62,5 +64,5 @@
   void *ptr, *new;
   int size;
-  int *marker;
+  size_t *marker;
 
   if (memlist == NULL) ohana_meminit ();
@@ -69,11 +71,11 @@
   size = Nelem * esize;
 
-  new = malloc (size + 8); /* 8 extra to save endposts */
+  new = malloc (size + 2*NMEMBYTE); /* 2 extra locations to save endposts */
   if (new == NULL) ohana_memabort ("failed to allocate memory (%s, %d)\n", file, line);
-  ptr = new + 4;
-
-  marker = (int *) new;
+  ptr = new + NMEMBYTE;
+
+  marker = (size_t *) new;
   *marker = 0xdeadbeef;
-  marker = (int *)(new + size + 4);
+  marker = (size_t *)(new + size + NMEMBYTE);
   *marker = 0xdeadbeef;
 
@@ -96,5 +98,5 @@
   int i, size;
   void *ptr, *ref, *new;
-  int *marker;
+  size_t *marker;
 
   if (memlist == NULL) ohana_memabort ("REALLOCATE before ALLOCATE");
@@ -103,5 +105,5 @@
   size = Nelem * esize;
 
-  ref = in - 4;
+  ref = in - NMEMBYTE;
 
   /* find old entry, update ptr, file, line */
@@ -113,12 +115,12 @@
 
       /* ask for new memory */
-      new = realloc (ref, size + 8); /* 8 extra to save endposts */
+      new = realloc (ref, size + 2*NMEMBYTE); /* 2 extra slots to save endposts */
       if (new == NULL) ohana_memabort ("failed to reallocate memory (%s, %d)\n", file, line);
-      ptr = new + 4;
+      ptr = new + NMEMBYTE;
       
       /* set the marker */
-      marker = (int *) new;
+      marker = (size_t *) new;
       *marker = 0xdeadbeef;
-      marker = (int *)(ptr + size);
+      marker = (size_t *)(ptr + size);
       *marker = 0xdeadbeef;
 
@@ -188,5 +190,5 @@
 
   int i, header;
-  int *marker;
+  size_t *marker;
   char top, bottom;
 
@@ -203,7 +205,7 @@
 
     top = bottom = 'Y';
-    marker = (int *)(memlist[i].ptr - 4);
+    marker = (size_t *)(memlist[i].ptr - NMEMBYTE);
     if (*marker == 0xdeadbeef) bottom = 'N';
-    marker = (int *)(memlist[i].ptr + memlist[i].size);
+    marker = (size_t *)(memlist[i].ptr + memlist[i].size);
     if (*marker == 0xdeadbeef) top = 'N';
     
@@ -242,11 +244,11 @@
     if ((allmemory == 0) && (memlist[i].state == STATE_FREE)) continue;
     if (memlist[i].state == STATE_EXTERNAL) {
-      fprintf (stderr, "%3d %4d %x : %x - external (external external) %c %s %d\n", 
-	       Ns[N], i, memlist[i].ptr, memlist[i].ptr, 
+      fprintf (stderr, "%3d %4d %lx : %lx - extern (extern     extern) %c %s %d\n", 
+	       Ns[N], i, (long)memlist[i].ptr, (long)memlist[i].ptr, 
 	       S[N], memlist[i].file, memlist[i].line);
     } else {
-      fprintf (stderr, "%3d %4d %x : %x - %x (%x %x) %c %s %d\n", 
-	       Ns[N], i, memlist[i].ptr, (memlist[i].ptr - 4), (memlist[i].ptr + memlist[i].size + 4), 
-	       *(long *)(memlist[i].ptr - 4), *(long *)(memlist[i].ptr + memlist[i].size), 
+      fprintf (stderr, "%3d %4d %lx : %lx - %lx (%lx %lx) %c %s %d\n", 
+	       Ns[N], i, (long)memlist[i].ptr, (long)(memlist[i].ptr - NMEMBYTE), (long)(memlist[i].ptr + memlist[i].size + NMEMBYTE), 
+	       *(long *)(memlist[i].ptr - NMEMBYTE), *(long *)(memlist[i].ptr + memlist[i].size), 
 	       S[N], memlist[i].file, memlist[i].line);
     }
