diff src/c/urweb.c @ 2208:cb74460f046a

Merge.
author Ziv Scully <ziv@mit.edu>
date Fri, 30 May 2014 12:00:44 -0400
parents c1a62ce47083 bcda3ae88677
children 0ca11d57c175
line wrap: on
line diff
--- a/src/c/urweb.c	Fri May 30 12:00:00 2014 -0400
+++ b/src/c/urweb.c	Fri May 30 12:00:44 2014 -0400
@@ -1264,8 +1264,8 @@
 static void align_heap(uw_context ctx) {
   size_t posn = ctx->heap.front - ctx->heap.start;
 
-  if (posn % 4 != 0) {
-    size_t bump = 4 - posn % 4;
+  if (posn % sizeof(void *) != 0) {
+    size_t bump = sizeof(void *) - posn % sizeof(void *);
     uw_check_heap(ctx, bump);
     ctx->heap.front += bump;
   }
@@ -1280,7 +1280,7 @@
   void *result;
 
   if (ctx->amInitializing) {
-    int error = posix_memalign(&result, 4, len);
+    int error = posix_memalign(&result, sizeof(void *), len);
 
     if (!error)
       return result;