emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] nick.lloyd-bytecode-jit fcc76c6 7/9: Free JIT contexts whe


From: Nickolas Lloyd
Subject: [Emacs-diffs] nick.lloyd-bytecode-jit fcc76c6 7/9: Free JIT contexts when compiled functions cleaned up
Date: Sun, 29 Jan 2017 16:30:46 +0000 (UTC)

branch: nick.lloyd-bytecode-jit
commit fcc76c6d04ce212d579620fcac9c166a0ff141b5
Author: Nickolas Lloyd <address@hidden>
Commit: Nickolas Lloyd <address@hidden>

    Free JIT contexts when compiled functions cleaned up
    
    * src/alloc.c (cleanup_vector): Call jit_context_destroy () to destroy a
    compiled function's associated context when it's pseudovector is destroyed.
---
 src/alloc.c |   11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/alloc.c b/src/alloc.c
index 100cefe..585be22 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -30,6 +30,10 @@ along with GNU Emacs.  If not, see 
<http://www.gnu.org/licenses/>.  */
 #include <pthread.h>
 #endif
 
+#ifdef HAVE_LIBJIT
+#include <jit.h>
+#endif
+
 #include "lisp.h"
 #include "dispextern.h"
 #include "intervals.h"
@@ -3214,6 +3218,13 @@ cleanup_vector (struct Lisp_Vector *vector)
     finalize_one_mutex ((struct Lisp_Mutex *) vector);
   else if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_CONDVAR))
     finalize_one_condvar ((struct Lisp_CondVar *) vector);
+  else if (PSEUDOVECTOR_TYPEP (&vector->header, PVEC_COMPILED)
+          && (void *)vector->contents[COMPILED_JIT_ID] != NULL)
+    {
+      jit_function_t func =
+       (jit_function_t )vector->contents[COMPILED_JIT_ID];
+      jit_context_destroy (jit_function_get_context (func));
+    }
 }
 
 /* Reclaim space used by unmarked vectors.  */



reply via email to

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