malloc and free are usually provided by the operating system aren't they? I
would check what free does for the specific playform. Cheers \n

Den fre 25 mars 2022 21:12Ridge McGhee <ridge.mcg...@gmail.com> skrev:

> 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.mcg...@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
>>
>>
>> _______________________________________________
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>
_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to