From 7cc838733848c58ea1c88fb477cfeefc941e3f32 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 4 Aug 2023 21:31:59 +0300 Subject: add compile_destroy as cleanup --- src/copyjit.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/copyjit.c') 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}; -- cgit v1.3