diff options
| author | Stefan Monnier | 2009-09-15 03:46:05 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-09-15 03:46:05 +0000 |
| commit | 0e328d3779d1b51ed3b7316f56735640d726980d (patch) | |
| tree | 2caf1c9bff7fa6dbd29e609b0f0907e1db8145be | |
| parent | 428b13d63c9041a71b06b6add5eeeed4b3c7ceaa (diff) | |
| download | emacs-0e328d3779d1b51ed3b7316f56735640d726980d.tar.gz emacs-0e328d3779d1b51ed3b7316f56735640d726980d.zip | |
Use after-load-functions to GC after loading each file.
Remove the explicit GC calls that used to be sprinkled around.
| -rw-r--r-- | lisp/ChangeLog | 3 | ||||
| -rw-r--r-- | lisp/loadup.el | 23 |
2 files changed, 11 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5b52b49ef78..df7f76399fd 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2009-09-15 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2009-09-15 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * loadup.el: Use after-load-functions to GC after loading each file. | ||
| 4 | Remove the explicit GC calls that used to be sprinkled around. | ||
| 5 | |||
| 3 | * subr.el (after-load-functions): New hook. | 6 | * subr.el (after-load-functions): New hook. |
| 4 | (do-after-load-evaluation): Run it. Use string-match-p to detect | 7 | (do-after-load-evaluation): Run it. Use string-match-p to detect |
| 5 | `obsolete' packages, rather than painfully extracting the relevant | 8 | `obsolete' packages, rather than painfully extracting the relevant |
diff --git a/lisp/loadup.el b/lisp/loadup.el index da7613bee25..63f7972b700 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el | |||
| @@ -60,6 +60,10 @@ | |||
| 60 | (load "emacs-lisp/backquote") | 60 | (load "emacs-lisp/backquote") |
| 61 | (load "subr") | 61 | (load "subr") |
| 62 | 62 | ||
| 63 | ;; Do it after subr, since both after-load-functions and add-hook are | ||
| 64 | ;; implemented in subr.el. | ||
| 65 | (add-hook 'after-load-functions '(lambda (f) (garbage-collect))) | ||
| 66 | |||
| 63 | ;; We specify .el in case someone compiled version.el by mistake. | 67 | ;; We specify .el in case someone compiled version.el by mistake. |
| 64 | (load "version.el") | 68 | (load "version.el") |
| 65 | 69 | ||
| @@ -82,17 +86,12 @@ | |||
| 82 | (load "button") | 86 | (load "button") |
| 83 | (load "startup") | 87 | (load "startup") |
| 84 | 88 | ||
| 85 | (message "Lists of integers (garbage collection statistics) are normal output") | ||
| 86 | (message "while building Emacs; they do not indicate a problem.") | ||
| 87 | (message "%s" (garbage-collect)) | ||
| 88 | |||
| 89 | (condition-case nil | 89 | (condition-case nil |
| 90 | ;; Don't get confused if someone compiled this by mistake. | 90 | ;; Don't get confused if someone compiled this by mistake. |
| 91 | (load "loaddefs.el") | 91 | (load "loaddefs.el") |
| 92 | ;; In case loaddefs hasn't been generated yet. | 92 | ;; In case loaddefs hasn't been generated yet. |
| 93 | (file-error (load "ldefs-boot.el"))) | 93 | (file-error (load "ldefs-boot.el"))) |
| 94 | 94 | ||
| 95 | (message "%s" (garbage-collect)) | ||
| 96 | (load "abbrev") ;lisp-mode.el and simple.el use define-abbrev-table. | 95 | (load "abbrev") ;lisp-mode.el and simple.el use define-abbrev-table. |
| 97 | (load "simple") | 96 | (load "simple") |
| 98 | 97 | ||
| @@ -159,7 +158,6 @@ | |||
| 159 | (load "isearch") | 158 | (load "isearch") |
| 160 | (load "rfn-eshadow") | 159 | (load "rfn-eshadow") |
| 161 | 160 | ||
| 162 | (message "%s" (garbage-collect)) | ||
| 163 | (load "menu-bar") | 161 | (load "menu-bar") |
| 164 | (load "paths.el") ;Don't get confused if someone compiled paths by mistake. | 162 | (load "paths.el") ;Don't get confused if someone compiled paths by mistake. |
| 165 | (load "emacs-lisp/lisp") | 163 | (load "emacs-lisp/lisp") |
| @@ -169,7 +167,6 @@ | |||
| 169 | (load "emacs-lisp/lisp-mode") | 167 | (load "emacs-lisp/lisp-mode") |
| 170 | (load "textmodes/text-mode") | 168 | (load "textmodes/text-mode") |
| 171 | (load "textmodes/fill") | 169 | (load "textmodes/fill") |
| 172 | (message "%s" (garbage-collect)) | ||
| 173 | 170 | ||
| 174 | (load "replace") | 171 | (load "replace") |
| 175 | (load "buff-menu") | 172 | (load "buff-menu") |
| @@ -187,8 +184,6 @@ | |||
| 187 | (load "term/common-win") | 184 | (load "term/common-win") |
| 188 | (load "term/x-win"))) | 185 | (load "term/x-win"))) |
| 189 | 186 | ||
| 190 | (message "%s" (garbage-collect)) | ||
| 191 | |||
| 192 | (if (eq system-type 'windows-nt) | 187 | (if (eq system-type 'windows-nt) |
| 193 | (progn | 188 | (progn |
| 194 | (load "w32-vars") | 189 | (load "w32-vars") |
| @@ -219,22 +214,18 @@ | |||
| 219 | (if (fboundp 'atan) ; preload some constants and | 214 | (if (fboundp 'atan) ; preload some constants and |
| 220 | (progn ; floating pt. functions if we have float support. | 215 | (progn ; floating pt. functions if we have float support. |
| 221 | (load "emacs-lisp/float-sup"))) | 216 | (load "emacs-lisp/float-sup"))) |
| 222 | (message "%s" (garbage-collect)) | ||
| 223 | 217 | ||
| 224 | (load "vc-hooks") | 218 | (load "vc-hooks") |
| 225 | (load "ediff-hook") | 219 | (load "ediff-hook") |
| 226 | (if (fboundp 'x-show-tip) (load "tooltip")) | 220 | (if (fboundp 'x-show-tip) (load "tooltip")) |
| 227 | 221 | ||
| 228 | (message "%s" (garbage-collect)) | ||
| 229 | |||
| 230 | ;If you want additional libraries to be preloaded and their | 222 | ;If you want additional libraries to be preloaded and their |
| 231 | ;doc strings kept in the DOC file rather than in core, | 223 | ;doc strings kept in the DOC file rather than in core, |
| 232 | ;you may load them with a "site-load.el" file. | 224 | ;you may load them with a "site-load.el" file. |
| 233 | ;But you must also cause them to be scanned when the DOC file | 225 | ;But you must also cause them to be scanned when the DOC file |
| 234 | ;is generated. | 226 | ;is generated. |
| 235 | ;For other systems, you must edit ../src/Makefile.in. | 227 | ;For other systems, you must edit ../src/Makefile.in. |
| 236 | (if (load "site-load" t) | 228 | (load "site-load" t) |
| 237 | (garbage-collect)) | ||
| 238 | 229 | ||
| 239 | ;; Determine which last version number to use | 230 | ;; Determine which last version number to use |
| 240 | ;; based on the executables that now exist. | 231 | ;; based on the executables that now exist. |
| @@ -327,11 +318,13 @@ | |||
| 327 | (equal (nth 4 command-line-args) "bootstrap")) | 318 | (equal (nth 4 command-line-args) "bootstrap")) |
| 328 | (setcdr load-path nil)) | 319 | (setcdr load-path nil)) |
| 329 | 320 | ||
| 321 | (remove-hook 'after-load-functions '(lambda (f) (garbage-collect))) | ||
| 322 | |||
| 330 | (setq inhibit-load-charset-map nil) | 323 | (setq inhibit-load-charset-map nil) |
| 331 | (clear-charset-maps) | 324 | (clear-charset-maps) |
| 332 | (garbage-collect) | 325 | (garbage-collect) |
| 333 | 326 | ||
| 334 | ;;; At this point, we're ready to resume undo recording for scratch. | 327 | ;; At this point, we're ready to resume undo recording for scratch. |
| 335 | (buffer-enable-undo "*scratch*") | 328 | (buffer-enable-undo "*scratch*") |
| 336 | 329 | ||
| 337 | (if (null (garbage-collect)) | 330 | (if (null (garbage-collect)) |