unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* More over-engineering
@ 2015-11-27 17:00 Stefan Monnier
  2015-11-27 17:12 ` Aurélien Aptel
  0 siblings, 1 reply; 17+ messages in thread
From: Stefan Monnier @ 2015-11-27 17:00 UTC (permalink / raw)
  To: emacs-devel

What's up with allocate_emacs_value in emacs-modules.c?

Are we really allocating a structure for every Lisp_Object value we pass
through the modules API?  Why do that?

The GC will find all Lisp_Object values that are stored in other Lisp
object or on the stack, so there are rather few remaining cases where
a Lisp_Object value has to be protected from GC.  For those remaining
cases, we do want to provide a way for the C code to "pin" the object
(we call it "gc-protect" them in Emacs's C code), but looking at the 
emacs-modules.c is looks like we don't even do that because those
emacs_value objects are auto-reclaimed when upon return, so they only
"protect" data whose lifetime doesn't escape the current module call
(and most of those cases correspond to having a Lisp_Object on the
stack, so there's no need for GC protection anyway).


        Stefan



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2015-12-06 21:16 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-27 17:00 More over-engineering Stefan Monnier
2015-11-27 17:12 ` Aurélien Aptel
2015-11-27 17:37   ` David Kastrup
2015-11-27 18:02   ` Stefan Monnier
2015-11-27 18:19     ` Eli Zaretskii
2015-11-27 18:53       ` Stefan Monnier
2015-11-27 19:32         ` Eli Zaretskii
2015-11-27 21:55           ` Stefan Monnier
2015-11-28  7:51             ` Eli Zaretskii
2015-11-28 16:22               ` Stefan Monnier
2015-11-28 16:34                 ` Eli Zaretskii
2015-11-28 23:13     ` Paul Eggert
2015-11-30 19:40       ` Stefan Monnier
2015-11-30 20:04         ` Eli Zaretskii
2015-11-30 20:39           ` Stefan Monnier
2015-11-30 20:49             ` Eli Zaretskii
2015-12-06 21:16               ` Paul Eggert

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).