aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/copyjit.c5
-rw-r--r--src/copyjit.h2
2 files changed, 7 insertions, 0 deletions
diff --git a/src/copyjit.c b/src/copyjit.c
index 0de85d3..96616e3 100644
--- a/src/copyjit.c
+++ b/src/copyjit.c
@@ -471,6 +471,11 @@ void compile_start(ctx_t *ctx)
ctx->pc = ctx->buf;
}
+void compile_destroy(ctx_t *ctx)
+{
+ munmap(ctx->buf, ctx->size);
+}
+
reloc_t compile_placeholder(ctx_t *ctx, compile_callback_t call)
{
reloc_t r = {0};
diff --git a/src/copyjit.h b/src/copyjit.h
index 8170204..6104800 100644
--- a/src/copyjit.h
+++ b/src/copyjit.h
@@ -44,6 +44,8 @@ void compile_patch(reloc_t reloc, void *addr);
void compile_start(ctx_t *ctx);
void compile_finish(ctx_t *ctx);
+void compile_destroy(ctx_t *ctx);
+
unsigned long run(ctx_t *ctx);
#endif /* HMMJIT_H */