diff options
| author | Philipp Stephani | 2017-04-22 18:04:29 +0200 |
|---|---|---|
| committer | Philipp | 2017-05-06 21:29:08 +0200 |
| commit | a3e9694078e24d19db860aa4ff8dec8bc34b59b7 (patch) | |
| tree | 235bf0857ebe0011ffd0b9cbef5f8daa242efbc1 /src/alloc.c | |
| parent | 5e47c2e52b9b7616668c5586084e0128b231272a (diff) | |
| download | emacs-a3e9694078e24d19db860aa4ff8dec8bc34b59b7.tar.gz emacs-a3e9694078e24d19db860aa4ff8dec8bc34b59b7.zip | |
Introduce new misc type for module function
This resolves a couple of FIXMEs in emacs-module.c.
* src/lisp.h (MODULE_FUNCTIONP, XMODULE_FUNCTION): New functions.
* src/alloc.c (make_module_function): New function.
(mark_object): GC support.
* src/data.c (Ftype_of, syms_of_data): Handle module function type.
* src/print.c (print_object): Print support for new type.
* src/emacs-module.c (module_make_function, Finternal_module_call):
Use new module function type, remove FIXMEs.
(module_format_fun_env): Adapt and give it external linkage.
* test/src/emacs-module-tests.el (module-function-object): Add unit
test.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/alloc.c b/src/alloc.c index ab6b2960af0..cecd9f55058 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -3943,6 +3943,12 @@ make_user_ptr (void (*finalizer) (void *), void *p) | |||
| 3943 | return obj; | 3943 | return obj; |
| 3944 | } | 3944 | } |
| 3945 | 3945 | ||
| 3946 | /* Create a new module function environment object. */ | ||
| 3947 | Lisp_Object | ||
| 3948 | make_module_function () | ||
| 3949 | { | ||
| 3950 | return allocate_misc (Lisp_Misc_Module_Function); | ||
| 3951 | } | ||
| 3946 | #endif | 3952 | #endif |
| 3947 | 3953 | ||
| 3948 | static void | 3954 | static void |
| @@ -6634,6 +6640,7 @@ mark_object (Lisp_Object arg) | |||
| 6634 | 6640 | ||
| 6635 | #ifdef HAVE_MODULES | 6641 | #ifdef HAVE_MODULES |
| 6636 | case Lisp_Misc_User_Ptr: | 6642 | case Lisp_Misc_User_Ptr: |
| 6643 | case Lisp_Misc_Module_Function: | ||
| 6637 | XMISCANY (obj)->gcmarkbit = true; | 6644 | XMISCANY (obj)->gcmarkbit = true; |
| 6638 | break; | 6645 | break; |
| 6639 | #endif | 6646 | #endif |