diff options
| author | Philipp Stephani | 2017-06-09 01:25:47 +0200 |
|---|---|---|
| committer | Philipp Stephani | 2017-06-09 01:25:47 +0200 |
| commit | 6e00ffe317797ead28ac45f9b609e35553bcdbd1 (patch) | |
| tree | bb7476cce152dc4232f7463df2792c029083873c /src/emacs-module.c | |
| parent | a62d15763df16e64b452b24191e12c0e32a2de6b (diff) | |
| download | emacs-6e00ffe317797ead28ac45f9b609e35553bcdbd1.tar.gz emacs-6e00ffe317797ead28ac45f9b609e35553bcdbd1.zip | |
Add garbage collection support for module environments
* src/emacs-module.c (mark_modules): New function.
(initialize_environment): Properly initialize Lisp objects.
* src/alloc.c (garbage_collect_1): Call it.
Diffstat (limited to 'src/emacs-module.c')
| -rw-r--r-- | src/emacs-module.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/emacs-module.c b/src/emacs-module.c index bebfe594426..1a8c1768230 100644 --- a/src/emacs-module.c +++ b/src/emacs-module.c | |||
| @@ -871,6 +871,7 @@ static void | |||
| 871 | initialize_environment (emacs_env *env, struct emacs_env_private *priv) | 871 | initialize_environment (emacs_env *env, struct emacs_env_private *priv) |
| 872 | { | 872 | { |
| 873 | priv->pending_non_local_exit = emacs_funcall_exit_return; | 873 | priv->pending_non_local_exit = emacs_funcall_exit_return; |
| 874 | priv->non_local_exit_symbol = priv->non_local_exit_data = Qnil; | ||
| 874 | env->size = sizeof *env; | 875 | env->size = sizeof *env; |
| 875 | env->private_members = priv; | 876 | env->private_members = priv; |
| 876 | env->make_global_ref = module_make_global_ref; | 877 | env->make_global_ref = module_make_global_ref; |
| @@ -926,6 +927,19 @@ finalize_runtime_unwind (void* raw_ert) | |||
| 926 | finalize_environment (&ert->private_members->pub); | 927 | finalize_environment (&ert->private_members->pub); |
| 927 | } | 928 | } |
| 928 | 929 | ||
| 930 | void | ||
| 931 | mark_modules (void) | ||
| 932 | { | ||
| 933 | Lisp_Object tail = Vmodule_environments; | ||
| 934 | FOR_EACH_TAIL_SAFE (tail) | ||
| 935 | { | ||
| 936 | emacs_env *env = XSAVE_POINTER (XCAR (tail), 0); | ||
| 937 | struct emacs_env_private *priv = env->private_members; | ||
| 938 | mark_object (priv->non_local_exit_symbol); | ||
| 939 | mark_object (priv->non_local_exit_data); | ||
| 940 | } | ||
| 941 | } | ||
| 942 | |||
| 929 | 943 | ||
| 930 | /* Non-local exit handling. */ | 944 | /* Non-local exit handling. */ |
| 931 | 945 | ||