summaryrefslogtreecommitdiff
path: root/lisp/loadup.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2010-04-18 17:49:33 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2010-04-18 17:49:33 -0400
commit5a98a2a69b1a15173ce4bfa53307608a7150b407 (patch)
tree6562162528ab87d94192f4ab016888f1bce95f11 /lisp/loadup.el
parentd88533fd6829f22cde052dce0742df01309a0990 (diff)
downloademacs-5a98a2a69b1a15173ce4bfa53307608a7150b407.tar.gz
Hash-cons pure data.
* alloc.c (Fpurecopy): Hash-cons if requested. (syms_of_alloc): Update purify-flag docstring. * loadup.el: Setup hash-cons for pure data.
Diffstat (limited to 'lisp/loadup.el')
-rw-r--r--lisp/loadup.el11
1 files changed, 8 insertions, 3 deletions
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 85222ce7d9e..95af8cdb47e 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -64,6 +64,10 @@
(expand-file-name "international" dir)
(expand-file-name "textmodes" dir)))))
+(if (eq t purify-flag)
+ ;; Hash consing saved around 11% of pure space in my tests.
+ (setq purify-flag (make-hash-table :test 'equal)))
+
(message "Using load-path %s" load-path)
(if (or (member (nth 3 command-line-args) '("dump" "bootstrap"))
@@ -345,6 +349,10 @@
;; At this point, we're ready to resume undo recording for scratch.
(buffer-enable-undo "*scratch*")
+;; Avoid error if user loads some more libraries now and make sure the
+;; hash-consing hash table is GC'd.
+(setq purify-flag nil)
+
(if (null (garbage-collect))
(setq pure-space-overflow t))
@@ -378,9 +386,6 @@
(add-name-to-file "emacs" name t)))
(kill-emacs)))
-;; Avoid error if user loads some more libraries now.
-(setq purify-flag nil)
-
;; For machines with CANNOT_DUMP defined in config.h,
;; this file must be loaded each time Emacs is run.
;; So run the startup code now. First, remove `-l loadup' from args.