aboutsummaryrefslogtreecommitdiff
path: root/src/copyjit.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2023-08-04 21:31:59 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2023-08-04 21:31:59 +0300
commit7cc838733848c58ea1c88fb477cfeefc941e3f32 (patch)
tree9126a797f62ef69278ee9502c043b7e59e0f2fc1 /src/copyjit.c
parentbf993be4a04bc7279f7d49ae18f185e1dca36479 (diff)
downloadcopyjit-7cc838733848c58ea1c88fb477cfeefc941e3f32.tar.gz
copyjit-7cc838733848c58ea1c88fb477cfeefc941e3f32.zip
add compile_destroy as cleanup
Diffstat (limited to 'src/copyjit.c')
-rw-r--r--src/copyjit.c5
1 files changed, 5 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};