changeset 2208:cb74460f046a

Merge.
author Ziv Scully <ziv@mit.edu>
date Fri, 30 May 2014 12:00:44 -0400 (2014-05-30)
parents f0f7bf234893 bcda3ae88677
children 0ca11d57c175
files src/c/urweb.c
diffstat 3 files changed, 48 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/c/request.c	Fri May 30 12:00:00 2014 -0400
+++ b/src/c/request.c	Fri May 30 12:00:44 2014 -0400
@@ -212,10 +212,10 @@
 }
 
 
-typedef struct uw_rc {
+struct uw_rc {
   size_t path_copy_size, queryString_size;
   char *path_copy, *queryString;
-} *uw_request_context;
+};
 
 uw_request_context uw_new_request_context(void) {
   uw_request_context r = malloc(sizeof(struct uw_rc));
--- 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;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/listinit.ur	Fri May 30 12:00:44 2014 -0400
@@ -0,0 +1,43 @@
+fun makeList n =
+    if n = 0 then
+        []
+    else
+        n :: makeList (n-1)
+
+fun sum ls =
+    case ls of
+        [] => 0
+      | n :: ls' => n + sum ls'
+
+val ls = 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: 1 :: 2 :: 3 :: 4 :: 5 :: 6 :: 7 :: 8 :: 9 :: 10
+           :: []
+
+task initialize = fn () =>
+                     debug (show (sum ls + sum ls))