# HG changeset patch # User Adam Chlipala # Date 1243791782 14400 # Node ID 249740301a0a5318729aaf8afccbed2902136d26 # Parent 5e1a4b12c83aad292cddd686efaa229258a94bf4 Fix pathmap bug; expose lower-level heap manipulation from C diff -r 5e1a4b12c83a -r 249740301a0a include/urweb.h --- a/include/urweb.h Sun May 31 12:41:34 2009 -0400 +++ b/include/urweb.h Sun May 31 13:43:02 2009 -0400 @@ -196,4 +196,8 @@ void uw_register_transactional(uw_context, void *data, uw_callback commit, uw_callback rollback, uw_callback free); +void uw_check_heap(uw_context, size_t extra); +char *uw_heap_front(uw_context); +void uw_set_heap_front(uw_context, char*); + #endif diff -r 5e1a4b12c83a -r 249740301a0a src/c/urweb.c --- a/src/c/urweb.c Sun May 31 12:41:34 2009 -0400 +++ b/src/c/urweb.c Sun May 31 13:43:02 2009 -0400 @@ -1033,10 +1033,18 @@ } } -static void uw_check_heap(uw_context ctx, size_t extra) { +void uw_check_heap(uw_context ctx, size_t extra) { buf_check_ctx(ctx, &ctx->heap, extra, "heap chunk"); } +char *uw_heap_front(uw_context ctx) { + return ctx->heap.front; +} + +void uw_set_heap_front(uw_context ctx, char *fr) { + ctx->heap.front = fr; +} + void *uw_malloc(uw_context ctx, size_t len) { void *result; diff -r 5e1a4b12c83a -r 249740301a0a src/compiler.sml --- a/src/compiler.sml Sun May 31 12:41:34 2009 -0400 +++ b/src/compiler.sml Sun May 31 13:43:02 2009 -0400 @@ -413,7 +413,7 @@ sources = #sources new @ #sources old } in - foldr (fn (fname, job) => merge (job, parseUrp' fname)) job (!libs) + foldr (fn (fname, job) => merge (job, pu fname)) job (!libs) end fun parsePkind s = @@ -876,7 +876,8 @@ val urweb_o = clibFile "urweb.o" val driver_o = clibFile "driver.o" - val compile = "gcc " ^ Config.gccArgs ^ " -Wstrict-prototypes -Werror -O3 -I include -c " ^ cname ^ " -o " ^ oname + val compile = "gcc " ^ Config.gccArgs ^ " -Wstrict-prototypes -Werror -O3 -I " ^ Config.includ + ^ " -c " ^ cname ^ " -o " ^ oname val link = "gcc -Werror -O3 -lm -lmhash -pthread " ^ libs ^ " " ^ urweb_o ^ " " ^ oname ^ " " ^ driver_o ^ " -o " ^ ename val (compile, link) =