From: Nickolas Lloyd Date: Sun, 1 Jan 2017 00:36:32 +0000 (-0500) Subject: Free JIT contexts when compiled functions cleaned up X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fcc76c6d04ce212d579620fcac9c166a0ff141b5;p=emacs.git 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. --- diff --git a/src/alloc.c b/src/alloc.c index 100cefeeb99..585be227941 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -30,6 +30,10 @@ along with GNU Emacs. If not, see . */ #include #endif +#ifdef HAVE_LIBJIT +#include +#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. */