Regarding my previous question:
I'm able to compile to memory and use the compiled function.
Now, how can I unload/delete the function from memory?

I use the following lines to allocate space and relocate the code
(presumably for the symbol table information and code):

  TCCState *state = tcc_new();
  tcc_set_output_type(state, TCC_OUTPUT_MEMORY);
  tcc_compile_string(state, code);
  void *mem = malloc( tcc_relocate(state, NULL) ); // get size
  tcc_relocate(state, mem);

If I use following line:

free(mem);

Will that completely free up the memory consumed by the symbol
table information and relocated code?

Thanks


On Fri, Mar 25, 2022 at 12:59 PM Ridge McGhee <[email protected]>
wrote:

> TinyCC is working well in my project.
>
> Question:
> I'm able to compile to memory and use the compiled function.
> Now, how can I unload/delete the function from memory?
>
> Thanks
>
>
>
_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to