diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-08-03 13:30:27 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-08-03 13:30:27 -0400 |
commit | b6123d25d202d3cbe1f12d24dec129a90d5051ec (patch) | |
tree | 5537d58d7dba623127804b35813d7c0ec673f8b9 /src/c | |
parent | 6314b4c27a14576b356258dad74607168135cb51 (diff) |
Optimizing 'case' in Mono_reduce
Diffstat (limited to 'src/c')
-rw-r--r-- | src/c/lacweb.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/c/lacweb.c b/src/c/lacweb.c index 7ee6daef..50f11ef1 100644 --- a/src/c/lacweb.c +++ b/src/c/lacweb.c @@ -192,8 +192,9 @@ static void lw_write_unsafe(lw_context ctx, const char* s) { } void lw_write(lw_context ctx, const char* s) { - lw_check(ctx, strlen(s)); + lw_check(ctx, strlen(s) + 1); lw_write_unsafe(ctx, s); + *ctx->page_front = 0; } @@ -510,7 +511,9 @@ lw_Basis_string lw_Basis_strcat(lw_context ctx, lw_Basis_string s1, lw_Basis_str int len = strlen(s1) + strlen(s2) + 1; char *s; - lw_check(ctx, len); + printf("s1 = %s\ns2 = %s\n", s1, s2); + + lw_check_heap(ctx, len); s = ctx->heap_front; @@ -518,5 +521,7 @@ lw_Basis_string lw_Basis_strcat(lw_context ctx, lw_Basis_string s1, lw_Basis_str strcat(s, s2); ctx->heap_front += len; + printf("s = %s\n", s); + return s; } |