1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-26 15:21:51 -08:00
emacs/test/src
Philipp Stephani 48ffef5ef4 Implement finalizers for module functions (Bug#30373)
* src/module-env-28.h: Add new module environment functions to
module environment for Emacs 28.

* src/emacs-module.h.in: Document that 'emacs_finalizer' also works
for function finalizers.

* src/emacs-module.c (CHECK_MODULE_FUNCTION): New function.
(struct Lisp_Module_Function): Add finalizer data member.
(module_make_function): Initialize finalizer.
(module_get_function_finalizer)
(module_set_function_finalizer): New module environment functions.
(module_finalize_function): New function.
(initialize_environment): Initialize new environment functions.

* src/alloc.c (cleanup_vector): Call potential module function
finalizer during garbage collection.

* test/data/emacs-module/mod-test.c (signal_error): New helper
function.
(memory_full): Use it.
(finalizer): New example function finalizer.
(Fmod_test_make_function_with_finalizer)
(Fmod_test_function_finalizer_calls): New test module functions.
(emacs_module_init): Define them.

* test/src/emacs-module-tests.el (module/function-finalizer): New unit
test.

* doc/lispref/internals.texi (Module Functions): Document new
functionality.
(Module Misc): Move description of 'emacs_finalizer' type to 'Module
Functions' node, and add a reference to it.

* etc/NEWS: Mention new functionality.
2020-01-03 19:24:10 +01:00
..
regex-resources
alloc-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
buffer-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
callint-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
callproc-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
casefiddle-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
charset-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
chartab-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
cmds-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
coding-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
data-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
decompress-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
doc-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
editfns-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
emacs-module-tests.el Implement finalizers for module functions (Bug#30373) 2020-01-03 19:24:10 +01:00
eval-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
fileio-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
floatfns-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
fns-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
font-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
inotify-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
json-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
keyboard-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
keymap-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
lcms-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
lread-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
marker-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
minibuf-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
print-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
process-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
regex-emacs-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
syntax-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
textprop-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
thread-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
timefns-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
undo-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00
xml-tests.el Update copyright year to 2020 2020-01-01 00:59:52 +00:00