diff options
| author | Richard M. Stallman | 1995-10-14 05:53:31 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-10-14 05:53:31 +0000 |
| commit | a59de17bafe51b4df454811c08affbf528005986 (patch) | |
| tree | 527ef7bc1983e5b4cab641b2ad41b7b42bc455bf /src/alloc.c | |
| parent | 5ebaddf5f9483a1ed0db8ffd9bbb69689cb6067f (diff) | |
| download | emacs-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.c | 23 |
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. */ |
| 167 | int ignore_warnings; | 167 | int ignore_warnings; |
| 168 | 168 | ||
| 169 | Lisp_Object Qgc_cons_threshold; | 169 | Lisp_Object Qgc_cons_threshold, Qchar_table_extra_slots; |
| 170 | 170 | ||
| 171 | static void mark_object (), mark_buffer (), mark_kboards (); | 171 | static void mark_object (), mark_buffer (), mark_kboards (); |
| 172 | static void clear_marks (), gc_sweep (); | 172 | static void clear_marks (), gc_sweep (); |
| @@ -756,22 +756,26 @@ See also the function `vector'.") | |||
| 756 | return vector; | 756 | return vector; |
| 757 | } | 757 | } |
| 758 | 758 | ||
| 759 | DEFUN ("make-char-table", Fmake_char_table, Smake_char_table, 0, 2, 0, | 759 | DEFUN ("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. |
| 761 | Each element is initialized to INIT, which defaults to nil.\n\ | 761 | Each element is initialized to INIT, which defaults to nil.\n\ |
| 762 | N may not be more than ten.\n\ | 762 | PURPOSE should be a symbol which has a `char-table-extra-slot' property.\n\ |
| 763 | See `char-table-extra-slot' and `set-char-table-extra-slot'.") | 763 | The 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); |