dotgnu-libjit
[Top][All Lists]
Advanced

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

[Dotgnu-libjit] PATCH: Don't leak function signatures when contexts are


From: GARCIA DE SORIA LUCENA, JUAN JESUS
Subject: [Dotgnu-libjit] PATCH: Don't leak function signatures when contexts are destroyed.
Date: Tue, 27 May 2008 16:21:57 +0200

Hi everyone.
 
We run libjit in some long-running servers that actually compile runtime-generated expressions. Those expressions are generated, evaluated (once or more times), and then destroyed.
 
When a given _expression_ gets evaluated for the second time, it's probable that it will be reused more times, so we perform some high level optimizations on its _expression_ tree, and the compile it to machine code via libjit. When the _expression_ is destroyed, the jit_context_t in which it was created gets released (we create a separate context per _expression_).
 
We found that libjit was leaking memory (the function signature) with each context. I attach a patch that fixes it by calling jit_type_free() on the signature in _jit_function_destroy().
 
 
Regards,
 
   Juan Jesus.
 

Attachment: free-function-signature-on-context-destruction.patch
Description: free-function-signature-on-context-destruction.patch


reply via email to

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