comparison src/c/lacweb.c @ 138:d6d78055f001

Change driver to use Pthreads
author Adam Chlipala <adamc@hcoop.net>
date Sat, 19 Jul 2008 18:56:57 -0400
parents 4ffdbf429e8d
children f0d3402184d1
comparison
equal deleted inserted replaced
137:4ffdbf429e8d 138:d6d78055f001
27 27
28 void lw_free(lw_context ctx) { 28 void lw_free(lw_context ctx) {
29 free(ctx->page); 29 free(ctx->page);
30 free(ctx->heap); 30 free(ctx->heap);
31 free(ctx); 31 free(ctx);
32 }
33
34 void lw_reset(lw_context ctx) {
35 ctx->page_front = ctx->page;
36 ctx->heap_front = ctx->heap;
32 } 37 }
33 38
34 static void lw_check_heap(lw_context ctx, size_t extra) { 39 static void lw_check_heap(lw_context ctx, size_t extra) {
35 if (ctx->heap_back - ctx->heap_front < extra) { 40 if (ctx->heap_back - ctx->heap_front < extra) {
36 size_t desired = ctx->heap_back - ctx->heap_front + extra, next; 41 size_t desired = ctx->heap_back - ctx->heap_front + extra, next;