aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Monnier2012-06-27 17:15:13 -0400
committerStefan Monnier2012-06-27 17:15:13 -0400
commit1ec4b7b25979ff9ea72a3ea35bf35d5882f467f7 (patch)
tree7d3f3d3ef4a151e8a2b93b653692a4a652d2a720 /src
parente309e2a56606ef774c5c366f74ea17ced46da065 (diff)
downloademacs-1ec4b7b25979ff9ea72a3ea35bf35d5882f467f7.tar.gz
emacs-1ec4b7b25979ff9ea72a3ea35bf35d5882f467f7.zip
Get rid of all the manual purecopy calls in menu-bar definitions.
* lisp/loadup.el (purify-flag): Pre-grow the hash-table to reduce the memory use. * lisp/bindings.el (bindings--define-key): New function. * lisp/vc/vc-hooks.el, lisp/replace.el, lisp/menu-bar.el: * lisp/international/mule-cmds.el, lisp/emacs-lisp/lisp-mode.el: * lisp/buff-menu.el, lisp/bookmark.el: * bindings.el: Use it to purecopy define-key bindings. * src/fns.c (maybe_resize_hash_table): Output message when growing the purify-hashtable.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog7
-rw-r--r--src/data.c2
-rw-r--r--src/fns.c11
-rw-r--r--src/puresize.h6
4 files changed, 21 insertions, 5 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index fc70a99a170..9af61d41353 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
2
3 * fns.c (maybe_resize_hash_table): Output message when growing the
4 purify-hashtable.
5
12012-06-27 Dmitry Antipov <dmantipov@yandex.ru> 62012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
2 7
3 * alloc.c (allocate_string_data): Remove dead code. 8 * alloc.c (allocate_string_data): Remove dead code.
@@ -29,7 +34,7 @@
29 34
302012-06-26 John Wiegley <johnw@newartisans.com> 352012-06-26 John Wiegley <johnw@newartisans.com>
31 36
32 * unexmacosx.c (copy_data_segment): Added two section names used 37 * unexmacosx.c (copy_data_segment): Add two section names used
33 on Mac OS X Lion: __mod_init_func and __mod_term_func. 38 on Mac OS X Lion: __mod_init_func and __mod_term_func.
34 39
35 * alloc.c (mark_memory): Do not check with -faddress-sanitizer 40 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
diff --git a/src/data.c b/src/data.c
index bd757cfdad1..fe7b9420344 100644
--- a/src/data.c
+++ b/src/data.c
@@ -517,7 +517,7 @@ DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0,
517 return newcdr; 517 return newcdr;
518} 518}
519 519
520/* Extract and set components of symbols */ 520/* Extract and set components of symbols. */
521 521
522DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0, 522DEFUN ("boundp", Fboundp, Sboundp, 1, 1, 0,
523 doc: /* Return t if SYMBOL's value is not void. */) 523 doc: /* Return t if SYMBOL's value is not void. */)
diff --git a/src/fns.c b/src/fns.c
index 515cd28328b..f734520fedb 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -3749,6 +3749,17 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h)
3749 if (INDEX_SIZE_BOUND < nsize) 3749 if (INDEX_SIZE_BOUND < nsize)
3750 error ("Hash table too large to resize"); 3750 error ("Hash table too large to resize");
3751 3751
3752#ifdef ENABLE_CHECKING
3753 if (HASH_TABLE_P (Vpurify_flag)
3754 && XHASH_TABLE (Vpurify_flag) == h)
3755 {
3756 Lisp_Object args[2];
3757 args[0] = build_string ("Growing hash table to: %d");
3758 args[1] = make_number (new_size);
3759 Fmessage (2, args);
3760 }
3761#endif
3762
3752 h->key_and_value = larger_vector (h->key_and_value, 3763 h->key_and_value = larger_vector (h->key_and_value,
3753 2 * (new_size - old_size), -1); 3764 2 * (new_size - old_size), -1);
3754 h->next = larger_vector (h->next, new_size - old_size, -1); 3765 h->next = larger_vector (h->next, new_size - old_size, -1);
diff --git a/src/puresize.h b/src/puresize.h
index 7f8f279f568..2f024345d61 100644
--- a/src/puresize.h
+++ b/src/puresize.h
@@ -47,9 +47,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
47#ifndef PURESIZE_RATIO 47#ifndef PURESIZE_RATIO
48#if EMACS_INT_MAX >> 31 != 0 48#if EMACS_INT_MAX >> 31 != 0
49#if PTRDIFF_MAX >> 31 != 0 49#if PTRDIFF_MAX >> 31 != 0
50#define PURESIZE_RATIO 10/6 /* Don't surround with `()'. */ 50#define PURESIZE_RATIO 10 / 6 /* Don't surround with `()'. */
51#else 51#else
52#define PURESIZE_RATIO 8/6 /* Don't surround with `()'. */ 52#define PURESIZE_RATIO 8 / 6 /* Don't surround with `()'. */
53#endif 53#endif
54#else 54#else
55#define PURESIZE_RATIO 1 55#define PURESIZE_RATIO 1
@@ -60,7 +60,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
60/* ENABLE_CHECKING somehow increases the purespace used, probably because 60/* ENABLE_CHECKING somehow increases the purespace used, probably because
61 it tends to cause some macro arguments to be evaluated twice. This is 61 it tends to cause some macro arguments to be evaluated twice. This is
62 a bug, but it's difficult to track it down. */ 62 a bug, but it's difficult to track it down. */
63#define PURESIZE_CHECKING_RATIO 12/10 /* Don't surround with `()'. */ 63#define PURESIZE_CHECKING_RATIO 12 / 10 /* Don't surround with `()'. */
64#else 64#else
65#define PURESIZE_CHECKING_RATIO 1 65#define PURESIZE_CHECKING_RATIO 1
66#endif 66#endif