Hi Michael,
Thanks, yep that's what I found too except I think that code doesn't run if you relocate to a user supplied block of memory (instead of the tcc managed one). My problem was that tcc_run_free() wasn't run on my allocated code memory when I freed it - leaving pages that have been returned to the heap marked as read-only/executable.
Happy enough to just keep the compiler instance around for now, but a little concerned what else it might be holding onto in memory (ie: other remnants from the compile process).
Brad
On 2024-01-17 06:14, draco via Tinycc-devel wrote:
Is it possible to keep, use and then release the compiled code after the initial compiler instance has been deleted (ie: after tcc_delete).
Actually I strugled with the same problem and found a partial solution:If you look up the code in libtcc.c, in function tcc_delete is the line tcc_run_free(s1);You have to outcomment this and it will not free the runtime memory; there you can also see, what else get's freed.But you can't free this later on, since s1 gets discarded, and if you dont save it somewhere its lost.Michael --______________________________________________________________ Aktuelle Lichtmaschinenkunsthttp://mir52.wordpress.comGlory be to thee Hong Kong_______________________________________________ Tinycc-devel mailing listTinycc-devel@nongnu.orghttps://lists.nongnu.org/mailman/listinfo/tinycc-devel
|