changeset 832:249740301a0a

Fix pathmap bug; expose lower-level heap manipulation from C
author Adam Chlipala <adamc@hcoop.net>
date Sun, 31 May 2009 13:43:02 -0400
parents 5e1a4b12c83a
children 9a1026e2b3f5
files include/urweb.h src/c/urweb.c src/compiler.sml
diffstat 3 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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;
 
--- 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) =