# HG changeset patch # User Ziv Scully # Date 1401465644 14400 # Node ID cb74460f046aec0cdad61088e858a7f81264b15c # Parent f0f7bf2348933b11db022b6f07e6fd416ef9619d# Parent bcda3ae886771d9aaef028246608392860b48c59 Merge. diff -r f0f7bf234893 -r cb74460f046a src/c/request.c --- 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)); diff -r f0f7bf234893 -r cb74460f046a src/c/urweb.c --- 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; diff -r f0f7bf234893 -r cb74460f046a tests/listinit.ur --- /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 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