aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorRichard M. Stallman1995-10-14 05:53:31 +0000
committerRichard M. Stallman1995-10-14 05:53:31 +0000
commita59de17bafe51b4df454811c08affbf528005986 (patch)
tree527ef7bc1983e5b4cab641b2ad41b7b42bc455bf /src/alloc.c
parent5ebaddf5f9483a1ed0db8ffd9bbb69689cb6067f (diff)
downloademacs-a59de17bafe51b4df454811c08affbf528005986.tar.gz
emacs-a59de17bafe51b4df454811c08affbf528005986.zip
(Qchar_table_extra_slots): New variable.
(syms_of_alloc): Initialize it. (Fmake_char_table): Take new arg PURPOSE and get N from a property.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/alloc.c b/src/alloc.c
index e747afd59cb..5cdbe7ffae0 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -166,7 +166,7 @@ int stack_copy_size;
166/* Non-zero means ignore malloc warnings. Set during initialization. */ 166/* Non-zero means ignore malloc warnings. Set during initialization. */
167int ignore_warnings; 167int ignore_warnings;
168 168
169Lisp_Object Qgc_cons_threshold; 169Lisp_Object Qgc_cons_threshold, Qchar_table_extra_slots;
170 170
171static void mark_object (), mark_buffer (), mark_kboards (); 171static void mark_object (), mark_buffer (), mark_kboards ();
172static void clear_marks (), gc_sweep (); 172static void clear_marks (), gc_sweep ();
@@ -756,22 +756,26 @@ See also the function `vector'.")
756 return vector; 756 return vector;
757} 757}
758 758
759DEFUN ("make-char-table", Fmake_char_table, Smake_char_table, 0, 2, 0, 759DEFUN ("make-char-table", Fmake_char_table, Smake_char_table, 1, 2, 0,
760 "Return a newly created char-table, with N \"extra\" slots.\n\ 760 "Return a newly created char-table, with purpose PURPOSE.
761Each element is initialized to INIT, which defaults to nil.\n\ 761Each element is initialized to INIT, which defaults to nil.\n\
762N may not be more than ten.\n\ 762PURPOSE should be a symbol which has a `char-table-extra-slot' property.\n\
763See `char-table-extra-slot' and `set-char-table-extra-slot'.") 763The property's value should be an integer between 0 and 10.")
764 (n, init) 764 (purpose, init)
765 register Lisp_Object n, init; 765 register Lisp_Object purpose, init;
766{ 766{
767 Lisp_Object vector; 767 Lisp_Object vector;
768 CHECK_NUMBER (n, 1); 768 Lisp_Object n;
769 CHECK_SYMBOL (purpose, 1);
770 n = Fget (purpose, Qchar_table_extra_slots);
771 CHECK_NUMBER (n, 0);
769 if (XINT (n) < 0 || XINT (n) > 10) 772 if (XINT (n) < 0 || XINT (n) > 10)
770 args_out_of_range (n, Qnil); 773 args_out_of_range (n, Qnil);
771 /* Add 2 to the size for the defalt and parent slots. */ 774 /* Add 2 to the size for the defalt and parent slots. */
772 vector = Fmake_vector (make_number (CHAR_TABLE_STANDARD_SLOTS + XINT (n)), 775 vector = Fmake_vector (make_number (CHAR_TABLE_STANDARD_SLOTS + XINT (n)),
773 init); 776 init);
774 XCHAR_TABLE (vector)->parent = Qnil; 777 XCHAR_TABLE (vector)->parent = Qnil;
778 XCHAR_TABLE (vector)->purpose = purpose;
775 XSETCHAR_TABLE (vector, XCHAR_TABLE (vector)); 779 XSETCHAR_TABLE (vector, XCHAR_TABLE (vector));
776 return vector; 780 return vector;
777} 781}
@@ -2608,6 +2612,9 @@ which includes both saved text and other data.");
2608 staticpro (&Qgc_cons_threshold); 2612 staticpro (&Qgc_cons_threshold);
2609 Qgc_cons_threshold = intern ("gc-cons-threshold"); 2613 Qgc_cons_threshold = intern ("gc-cons-threshold");
2610 2614
2615 staticpro (&Qchar_table_extra_slots);
2616 Qchar_table_extra_slots = intern ("char-table-extra-slots");
2617
2611 defsubr (&Scons); 2618 defsubr (&Scons);
2612 defsubr (&Slist); 2619 defsubr (&Slist);
2613 defsubr (&Svector); 2620 defsubr (&Svector);