diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-08-04 21:31:59 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-08-04 21:31:59 +0300 |
| commit | 7cc838733848c58ea1c88fb477cfeefc941e3f32 (patch) | |
| tree | 9126a797f62ef69278ee9502c043b7e59e0f2fc1 /src | |
| parent | bf993be4a04bc7279f7d49ae18f185e1dca36479 (diff) | |
| download | copyjit-7cc838733848c58ea1c88fb477cfeefc941e3f32.tar.gz copyjit-7cc838733848c58ea1c88fb477cfeefc941e3f32.zip | |
add compile_destroy as cleanup
Diffstat (limited to 'src')
| -rw-r--r-- | src/copyjit.c | 5 | ||||
| -rw-r--r-- | src/copyjit.h | 2 |
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 */ |
