all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* garbage-collect not called for .el files in loadup.el
@ 2009-11-04  2:00 Dan Nicolaescu
  2009-11-04  3:47 ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Nicolaescu @ 2009-11-04  2:00 UTC (permalink / raw
  To: emacs-devel


As the subject says, GC is not done after loading .el files in
loadup.el, only .elc files.  

These files are loaded with `load-with-code-conversion', which does:
      (unless purify-flag
         (do-after-load-evaluation fullname))

do-after-load-evaluation runs the `after-load-functions' hook.

So hoa bout this patch?

Index: mule.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/international/mule.el,v
retrieving revision 1.290
diff -u -3 -p -u -p -r1.290 mule.el
--- mule.el   26 Oct 2009 15:18:04 -0000        1.290
+++ mule.el   4 Nov 2009 01:53:55 -0000
@@ -353,7 +353,8 @@ Return t if file exists."
                  ))
                  (let (kill-buffer-hook kill-buffer-query-functions)
                    (kill-buffer buffer)))
-      (unless purify-flag
+      (if purify-flag
+        (run-hook-with-args 'after-load-functions fullname)
        (do-after-load-evaluation fullname))
 
       (unless (or nomessage noninteractive)




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

* Re: garbage-collect not called for .el files in loadup.el
  2009-11-04  2:00 garbage-collect not called for .el files in loadup.el Dan Nicolaescu
@ 2009-11-04  3:47 ` Stefan Monnier
  2009-11-04  4:13   ` Dan Nicolaescu
  0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2009-11-04  3:47 UTC (permalink / raw
  To: Dan Nicolaescu; +Cc: emacs-devel

> As the subject says, GC is not done after loading .el files in
> loadup.el, only .elc files.

What difference does it make in practice?

> -      (unless purify-flag
> +      (if purify-flag
> +        (run-hook-with-args 'after-load-functions fullname)
>         (do-after-load-evaluation fullname))

Nope, sorry, that's ugly.  You can simply remove the `unless
purify-flag' on the other hand, since Fload calls
do-after-load-evaluation unconditionally.


        Stefan




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

* Re: garbage-collect not called for .el files in loadup.el
  2009-11-04  3:47 ` Stefan Monnier
@ 2009-11-04  4:13   ` Dan Nicolaescu
  2009-11-04  5:05     ` Stefan Monnier
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Nicolaescu @ 2009-11-04  4:13 UTC (permalink / raw
  To: Stefan Monnier; +Cc: emacs-devel

Stefan Monnier <monnier@iro.umontreal.ca> writes:

  > > As the subject says, GC is not done after loading .el files in
  > > loadup.el, only .elc files.
  > 
  > What difference does it make in practice?

More garbage is produced before gc, so the memory layout is worse. 


  > > -      (unless purify-flag
  > > +      (if purify-flag
  > > +        (run-hook-with-args 'after-load-functions fullname)
  > >         (do-after-load-evaluation fullname))
  > 
  > Nope, sorry, that's ugly.  You can simply remove the `unless
  > purify-flag' on the other hand, since Fload calls
  > do-after-load-evaluation unconditionally.

Not when using `load-source-file-function':

      /* We are loading a source file (*.el).  */
      if (!NILP (Vload_source_file_function))
        {
          Lisp_Object val;

          if (fd >= 0)
            emacs_close (fd);
          val = call4 (Vload_source_file_function, found, hist_file_name,
                       NILP (noerror) ? Qnil : Qt,
                       (NILP (nomessage) || force_load_messages) ? Qnil : Qt);
          return unbind_to (count, val);
        }




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

* Re: garbage-collect not called for .el files in loadup.el
  2009-11-04  4:13   ` Dan Nicolaescu
@ 2009-11-04  5:05     ` Stefan Monnier
  0 siblings, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2009-11-04  5:05 UTC (permalink / raw
  To: Dan Nicolaescu; +Cc: emacs-devel

>> > As the subject says, GC is not done after loading .el files in
>> > loadup.el, only .elc files.
>> What difference does it make in practice?
> More garbage is produced before gc, so the memory layout is worse.

That's obvious, but that doesn't tell me "what difference does it make
in practice?".

>> > -      (unless purify-flag
>> > +      (if purify-flag
>> > +        (run-hook-with-args 'after-load-functions fullname)
>> >         (do-after-load-evaluation fullname))
>> 
>> Nope, sorry, that's ugly.  You can simply remove the `unless
>> purify-flag' on the other hand, since Fload calls
>> do-after-load-evaluation unconditionally.

> Not when using `load-source-file-function':

That's not what I meant.  I meant that Fload doesn't check purify-flag
before calling do-after-load-evaluation.


        Stefan




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

end of thread, other threads:[~2009-11-04  5:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-04  2:00 garbage-collect not called for .el files in loadup.el Dan Nicolaescu
2009-11-04  3:47 ` Stefan Monnier
2009-11-04  4:13   ` Dan Nicolaescu
2009-11-04  5:05     ` Stefan Monnier

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.