1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-21 03:52:16 -08:00

* Fix memory leak when native compiled function is collected

* src/alloc.c (cleanup_vector): Handle native compiled
	functions.
This commit is contained in:
Andrea Corallo 2020-06-11 23:24:00 +02:00
parent 904550d8c8
commit ab78ed83b9

View file

@ -3156,6 +3156,17 @@ cleanup_vector (struct Lisp_Vector *vector)
PSEUDOVEC_STRUCT (vector, Lisp_Native_Comp_Unit);
dispose_comp_unit (cu, true);
}
else if (NATIVE_COMP_FLAG
&& PSEUDOVECTOR_TYPEP (&vector->header, PVEC_SUBR))
{
struct Lisp_Subr *subr =
PSEUDOVEC_STRUCT (vector, Lisp_Subr);
if (subr->native_comp_u[0])
{
xfree (subr->symbol_name);
xfree (subr->native_c_name[0]);
}
}
}
/* Reclaim space used by unmarked vectors. */