tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Quick question


From: Ridge McGhee
Subject: Re: [Tinycc-devel] Quick question
Date: Fri, 25 Mar 2022 13:11:02 -0700

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 <ridge.mcghee@gmail.com> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]