Mercurial > urweb
comparison src/c/urweb.c @ 324:b91480c9a729
More opportunities to use regions and lack of string copying
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 11 Sep 2008 13:06:51 -0400 |
parents | 5030e909fbf3 |
children | 7009b0ac1501 |
comparison
equal
deleted
inserted
replaced
323:5030e909fbf3 | 324:b91480c9a729 |
---|---|
203 if (r == NULL) | 203 if (r == NULL) |
204 uw_error(ctx, FATAL, "Region stack underflow"); | 204 uw_error(ctx, FATAL, "Region stack underflow"); |
205 | 205 |
206 ctx->heap_front = (char *) r; | 206 ctx->heap_front = (char *) r; |
207 ctx->regions = r->next; | 207 ctx->regions = r->next; |
208 } | |
209 | |
210 void uw_memstats(uw_context ctx) { | |
211 printf("Page: %d/%d\n", ctx->page_front - ctx->page, ctx->page_back - ctx->page); | |
212 printf("Heap: %d/%d\n", ctx->heap_front - ctx->heap, ctx->heap_back - ctx->heap); | |
208 } | 213 } |
209 | 214 |
210 int uw_really_send(int sock, const void *buf, ssize_t len) { | 215 int uw_really_send(int sock, const void *buf, ssize_t len) { |
211 while (len > 0) { | 216 while (len > 0) { |
212 ssize_t n = send(sock, buf, len, 0); | 217 ssize_t n = send(sock, buf, len, 0); |