summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-05-31 13:43:02 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-05-31 13:43:02 -0400
commit8c06af6123389e9f4a2302e08230b1e5aaadb590 (patch)
tree51ecf2038eca9a8eed5601a561c0510ebba247c7
parentf28d649eedad9ebd39dab473150faa9001bcb017 (diff)
Fix pathmap bug; expose lower-level heap manipulation from C
-rw-r--r--include/urweb.h4
-rw-r--r--src/c/urweb.c10
-rw-r--r--src/compiler.sml5
3 files changed, 16 insertions, 3 deletions
diff --git a/include/urweb.h b/include/urweb.h
index 73f06da7..a286f9c8 100644
--- a/include/urweb.h
+++ b/include/urweb.h
@@ -196,4 +196,8 @@ __attribute__((noreturn)) void uw_return_blob(uw_context, uw_Basis_blob, uw_Basi
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 --git a/src/c/urweb.c b/src/c/urweb.c
index ffef10e7..0c6eefd5 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -1033,10 +1033,18 @@ static void buf_check_ctx(uw_context ctx, buf *b, size_t extra, const char *desc
}
}
-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 --git a/src/compiler.sml b/src/compiler.sml
index b0dfe387..fb5ed0e0 100644
--- a/src/compiler.sml
+++ b/src/compiler.sml
@@ -413,7 +413,7 @@ fun parseUrp' fname =
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 @@ fun compileC {cname, oname, ename, libs, profile, debug, link = link'} =
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) =