diff options
| author | Andrea Corallo | 2020-06-11 23:24:00 +0200 |
|---|---|---|
| committer | Andrea Corallo | 2020-06-11 18:37:40 +0200 |
| commit | ab78ed83b977084885265a1842e4e474e0938d9f (patch) | |
| tree | 908300baac704c93498303a80a95b5e103b11e7b /src/alloc.c | |
| parent | 904550d8c8e1583d0444bcb28b5d1130af6bafc3 (diff) | |
| download | emacs-ab78ed83b977084885265a1842e4e474e0938d9f.tar.gz emacs-ab78ed83b977084885265a1842e4e474e0938d9f.zip | |
* Fix memory leak when native compiled function is collected
* src/alloc.c (cleanup_vector): Handle native compiled
functions.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c index 9a9dbb52e7b..750ffbd2dd8 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -3156,6 +3156,17 @@ cleanup_vector (struct Lisp_Vector *vector) | |||
| 3156 | PSEUDOVEC_STRUCT (vector, Lisp_Native_Comp_Unit); | 3156 | PSEUDOVEC_STRUCT (vector, Lisp_Native_Comp_Unit); |
| 3157 | dispose_comp_unit (cu, true); | 3157 | dispose_comp_unit (cu, true); |
| 3158 | } | 3158 | } |
| 3159 | else if (NATIVE_COMP_FLAG | ||
| 3160 | && PSEUDOVECTOR_TYPEP (&vector->header, PVEC_SUBR)) | ||
| 3161 | { | ||
| 3162 | struct Lisp_Subr *subr = | ||
| 3163 | PSEUDOVEC_STRUCT (vector, Lisp_Subr); | ||
| 3164 | if (subr->native_comp_u[0]) | ||
| 3165 | { | ||
| 3166 | xfree (subr->symbol_name); | ||
| 3167 | xfree (subr->native_c_name[0]); | ||
| 3168 | } | ||
| 3169 | } | ||
| 3159 | } | 3170 | } |
| 3160 | 3171 | ||
| 3161 | /* Reclaim space used by unmarked vectors. */ | 3172 | /* Reclaim space used by unmarked vectors. */ |