diff 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
line wrap: on
line diff
--- a/src/c/urweb.c	Thu Sep 11 12:40:40 2008 -0400
+++ b/src/c/urweb.c	Thu Sep 11 13:06:51 2008 -0400
@@ -207,6 +207,11 @@
   ctx->regions = r->next;
 }
 
+void uw_memstats(uw_context ctx) {
+  printf("Page: %d/%d\n", ctx->page_front - ctx->page, ctx->page_back - ctx->page);
+  printf("Heap: %d/%d\n", ctx->heap_front - ctx->heap, ctx->heap_back - ctx->heap);
+}
+
 int uw_really_send(int sock, const void *buf, ssize_t len) {
   while (len > 0) {
     ssize_t n = send(sock, buf, len, 0);