align to 8 byte boundaries
authorbdemsky <bdemsky>
Sat, 14 Mar 2009 01:38:31 +0000 (01:38 +0000)
committerbdemsky <bdemsky>
Sat, 14 Mar 2009 01:38:31 +0000 (01:38 +0000)
Robust/src/Runtime/garbage.c

index 6fdbc27f4bfac2cb45149be726a1f0a599689773..47f4ae3adaea846fc2315b60a464b2a622c31608 100644 (file)
@@ -411,8 +411,8 @@ void fixtags() {
 
 void * tomalloc(int size) {
   void * ptr=to_heapptr;
-  if ((size%4)!=0)
-    size+=(4-(size%4));
+  if ((size&7)!=0)
+    size+=(8-(size%8));
   to_heapptr+=size;
   return ptr;
 }
@@ -480,8 +480,8 @@ void * mygcmalloc(struct garbagelist * stackptr, int size) {
   }
 #endif
   ptr=curr_heapptr;
-  if ((size%4)!=0)
-    size+=(4-(size%4));
+  if ((size&7)!=0)
+    size+=(8-(size%8));
   curr_heapptr+=size;
   if (curr_heapptr>curr_heapgcpoint) {
     if (curr_heapbase==0) {
@@ -509,8 +509,8 @@ void * mygcmalloc(struct garbagelist * stackptr, int size) {
       int last_heapsize=0;
       if (lastgcsize>0) {
        last_heapsize=HEAPSIZE(lastgcsize, size);
-       if ((last_heapsize%4)!=0)
-         last_heapsize+=(4-(last_heapsize%4));
+       if ((last_heapsize&7)!=0)
+         last_heapsize+=(8-(last_heapsize%8));
       }
       if (curr_heapsize>last_heapsize)
        last_heapsize=curr_heapsize;