aboutsummaryrefslogtreecommitdiff
path: root/libtcc.c
diff options
context:
space:
mode:
authorgrischka <grischka>2016-10-19 19:21:27 +0200
committergrischka <grischka>2016-10-19 19:21:27 +0200
commitbfd1c08d6c579445fe75dd633fbd9b0757cea5d0 (patch)
tree299e8c05200731561bd7f6bbe3d733fd9c3a4e94 /libtcc.c
parent02919cd27506e25dacdbe72dad1ae2718eb75991 (diff)
downloadtinycc-bfd1c08d6c579445fe75dd633fbd9b0757cea5d0.tar.gz
tinycc-bfd1c08d6c579445fe75dd633fbd9b0757cea5d0.tar.bz2
tccrun/win64: cleanup runtime function table
- call RtlDeleteFunctionTable (important for multiple compilations) - the RUNTIME_FUNCTION* is now at the beginning of the runtime memory. Therefor when tcc_relocate is called with user memory, this should be done manually before it is free'd: RtlDeleteFunctionTable(*(void**)user_mem); [ free(user_mem); ] - x86_64-gen.c: expand char/short return values to int
Diffstat (limited to 'libtcc.c')
-rw-r--r--libtcc.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/libtcc.c b/libtcc.c
index 1b4b354..f184502 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -931,12 +931,8 @@ LIBTCCAPI void tcc_delete(TCCState *s1)
dynarray_reset(&s1->pragma_libs, &s1->nb_pragma_libs);
#ifdef TCC_IS_NATIVE
-# ifdef HAVE_SELINUX
- munmap (s1->write_mem, s1->mem_size);
- munmap (s1->runtime_mem, s1->mem_size);
-# else
- tcc_free(s1->runtime_mem);
-# endif
+ /* free runtime memory */
+ tcc_run_free(s1);
#endif
tcc_free(s1->sym_attrs);