diff options
author | Aurélien Aptel <aurelien.aptel@gmail.com> | 2015-02-11 02:15:14 +0100 |
---|---|---|
committer | Aurélien Aptel <aurelien.aptel@gmail.com> | 2015-02-11 02:15:14 +0100 |
commit | c59f2deaae99ca85b0a4fcdd53a3d8ed41d995cd (patch) | |
tree | 455db9967d881b610b400ea53c70f87b08eba496 /src/print.c | |
parent | 9dc8a56a4dc27a752186185743c4fc16c8fced45 (diff) | |
download | emacs-feature/aptel/dynamic-modules-rc3.tar.gz |
add new Lisp_Module type (misc subtype)feature/aptel/dynamic-modules-rc3
Lisp_Module is a new subtype of Misc objects. As other Misc types, it
re-uses the marker free list.
A module must have a custom destructor, which is automatically called
by the GC.
Previous module object using the Save_Value type still work and they
still have to be free explicitely from Lisp. Their use is now
discouraged in modules.
A simple module example + tests are available in modules/memtest.
Diffstat (limited to 'src/print.c')
-rw-r--r-- | src/print.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/print.c b/src/print.c index 1a0aebbeba7..db41adc8add 100644 --- a/src/print.c +++ b/src/print.c @@ -2045,6 +2045,23 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun, bool escapeflag) PRINTCHAR ('>'); break; +#ifdef HAVE_LTDL + case Lisp_Misc_Module: + strout ("#<module id = ", -1, -1, printcharfun); + { + int len = sprintf (buf, "%u", XMODULE (obj)->id); + strout (buf, len, len, printcharfun); + strout (", dtor = ", -1, -1, printcharfun); + len = sprintf (buf, "%p", XMODULE (obj)->dtor); + strout (buf, len, len, printcharfun); + strout (", p = ", -1, -1, printcharfun); + len = sprintf (buf, "%p", XMODULE (obj)->p); + strout (buf, len, len, printcharfun); + strout (">", -1, -1, printcharfun); + } + break; +#endif + /* Remaining cases shouldn't happen in normal usage, but let's print them anyway for the benefit of the debugger. */ |