diff options
| author | Pip Cet | 2021-05-16 15:44:26 +0200 |
|---|---|---|
| committer | Stefan Monnier | 2022-07-01 18:59:35 -0400 |
| commit | b6a526361b57f8d9f6d5078ccd97832d0a1fb036 (patch) | |
| tree | 0c752a1c74920a2b731bb2e3c2ff6623be240a72 /src/data.c | |
| parent | 3daf833ff3f3e99b44731808cb197c0912649997 (diff) | |
| download | emacs-scratch/no-purespace-old.tar.gz emacs-scratch/no-purespace-old.zip | |
Remove purespace and ancillary codescratch/no-purespace-old
Now that purespace is not used any more, remove it, along with the functions
used to allocate into it. Use equivalent functions allocating into the
normal heap.
Remove calls to PURE_P since they always return false.
* src/puresize.h: Delete file.
* src/alloc.c: Don't include `puresize.h` any more.
(pure, purebeg, pure_size, pure_bytes_used_before_overflow)
(pure_bytes_used_lisp, pure_bytes_used_non_lisp, symbol_block_pinned)
(pinned_objects): Delete vars.
(PUREBEG): Delete macro.
(pointer_align): Move after definition of USE_ALIGNED_ALLOC and only
define it if USE_ALIGNED_ALLOC is not used.
(cons_listn): Remove `cons` arg, hardcode `Fcons` instead.
(pure_listn, pure_alloc, check_pure_size, make_pure_string)
(make_pure_c_string, pure_cons): Delete functions.
(init_symbol): Don't set `pinned` any more.
(mark_pinned_objects, mark_pinned_symbols): Delete functions.
(garbage_collect): Don't call them any more.
(init_alloc_once_for_pdumper): Don't initialize purebeg and pure_size.
* src/print.c (print_object) <PVEC_HASH_TABLE>: Don't print `purecopy`.
* src/pdumper.c (dump_symbol, dump_hash_table): Update sig hash.
(dump_symbol): Don't dump `pinned`.
(dump_hash_table): Don't dump `purecopy`.
* src/lread.c (readevalloop, read_internal_start): Adjust call to
`make_hash_table`.
(read0, intern_c_string_1, define_symbol, Fintern): Don't purify
symbol names.
(string): Avoid `pure_cons` and `build_pure_c_string`.
* src/lisp.h (struct Lisp_Symbol): Remove `pinned` field.
(struct Lisp_Hash_Table): Remove `purecopy` field.
(check_pure_size, pure_listn, pure_list, make_pure_string)
(make_pure_c_string, pure_cons): Remove prototypes.
(build_pure_c_string): Delete function.
* src/keymap.c: Don't include `puresize.h` any more.
(Fmake_sparse_keymap): Don't purecopy the menu name.
(Fset_keymap_parent, store_in_keymap): Don't `CHECK_IMPURE` any more.
(syms_of_keymap): Avoid `pure_cons` and `build_pure_c_string`.
* src/intervals.c: Don't include `puresize.h` any more.
(create_root_interval): Don't `CHECK_IMPURE` any more.
* src/fns.c: Don't include `puresize.h` any more.
(Ffillarray, Fclear_string): Don't `CHECK_IMPURE` any more.
(make_hash_table): Remove `purecopy` arg.
(Fmake_hash_table): Remove `:purecopy` keyword argument.
* src/eval.c (Finternal__define_uninitialized_variable): Don't purecopy
the doc any more.
(Fdefconst_1): Don't purecopy the initvalue any more.
(Fautoload): Get rid of hack needed when we used hash-consing.
(syms_of_eval): Avoid `build_pure_c_string`.
* src/emacs.c: Don't include `puresize.h` any more.
(Fdump_emacs): Don't `check_pure_size`.
* src/doc.c (Fsnarf_documentation): Don't purecopy the build files.
* src/deps.mk: Remove puresize.h.
* src/data.c: Don't include `puresize.h` any more.
(pure_write_error): Delete function.
(Fsetcar, Fsetcdr): Don't `CHECK_IMPURE` any more.
(Fdefalias): Don't purecopy the definition any more.
(Faset): Don't `CHECK_IMPURE` any more.
(syms_of_data): Avoid `pure_cons` and `build_pure_c_string`.
* src/conf_post.h (SYSTEM_PURESIZE_EXTRA): Delete macro.
* src/comp.c: Don't include `puresize.h` any more.
(helper_link_table): Remove `pure_write_error`.
(define_CHECK_IMPURE): Delete function.
(maybe_defer_native_compilation, syms_of_comp):
Avoid `build_pure_c_string`.
* src/category.c (hash_get_category_set): Update call to `make_hash_table`.
(Fdefine_category): Don't purecopy the docstring any more.
* src/bytecode.c: Don't include `puresize.h` any more.
(Bsetcar, Bsetcdr): Don't `CHECK_IMPURE` any more.
* doc/lispref/internals.texi (Pure Storage): Delete section.
(Garbage Collection): Remove note about purespace overflow.
* src/xfaces.c (syms_of_xfaces):
* src/emacs-module.c (syms_of_module):
* src/frame.c (make_frame, make_initial_frame):
* src/fileio.c (syms_of_fileio):
* src/image.c (xpm_make_color_table_h):
* src/process.c (ADD_SUBFEATURE, syms_of_process):
* src/profiler.c (make_log):
* src/json.c (define_error):
* src/xterm.c (syms_of_xterm):
* src/xfns.c (syms_of_xfns):
* src/xdisp.c (syms_of_xdisp):
* src/w32fns.c (syms_of_w32fns):
* src/syntax.c (syms_of_syntax):
* src/sqlite.c (syms_of_sqlite):
* src/search.c (syms_of_search):
* src/keyboard.c (syms_of_keyboard):
* src/fontset.c (syms_of_fontset):
* src/dbusbind.c (syms_of_dbusbind):
* src/coding.c (syms_of_coding):
* src/callint.c (syms_of_callint):
* src/buffer.c (init_buffer_once, syms_of_buffer):
Avoid `build_pure_c_string`, `Fpurecopy`, `pure_cons`, and `pure_list`,
and adjust calls to `make_hash_table`.
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 37 |
1 files changed, 11 insertions, 26 deletions
diff --git a/src/data.c b/src/data.c index 1dbec4687b8..69ed68782b0 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -30,7 +30,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 30 | 30 | ||
| 31 | #include "lisp.h" | 31 | #include "lisp.h" |
| 32 | #include "bignum.h" | 32 | #include "bignum.h" |
| 33 | #include "puresize.h" | ||
| 34 | #include "character.h" | 33 | #include "character.h" |
| 35 | #include "buffer.h" | 34 | #include "buffer.h" |
| 36 | #include "keyboard.h" | 35 | #include "keyboard.h" |
| @@ -144,12 +143,6 @@ wrong_type_argument (Lisp_Object predicate, Lisp_Object value) | |||
| 144 | } | 143 | } |
| 145 | 144 | ||
| 146 | void | 145 | void |
| 147 | pure_write_error (Lisp_Object obj) | ||
| 148 | { | ||
| 149 | xsignal2 (Qerror, build_string ("Attempt to modify read-only object"), obj); | ||
| 150 | } | ||
| 151 | |||
| 152 | void | ||
| 153 | args_out_of_range (Lisp_Object a1, Lisp_Object a2) | 146 | args_out_of_range (Lisp_Object a1, Lisp_Object a2) |
| 154 | { | 147 | { |
| 155 | xsignal2 (Qargs_out_of_range, a1, a2); | 148 | xsignal2 (Qargs_out_of_range, a1, a2); |
| @@ -645,7 +638,6 @@ DEFUN ("setcar", Fsetcar, Ssetcar, 2, 2, 0, | |||
| 645 | (register Lisp_Object cell, Lisp_Object newcar) | 638 | (register Lisp_Object cell, Lisp_Object newcar) |
| 646 | { | 639 | { |
| 647 | CHECK_CONS (cell); | 640 | CHECK_CONS (cell); |
| 648 | CHECK_IMPURE (cell, XCONS (cell)); | ||
| 649 | XSETCAR (cell, newcar); | 641 | XSETCAR (cell, newcar); |
| 650 | return newcar; | 642 | return newcar; |
| 651 | } | 643 | } |
| @@ -655,7 +647,6 @@ DEFUN ("setcdr", Fsetcdr, Ssetcdr, 2, 2, 0, | |||
| 655 | (register Lisp_Object cell, Lisp_Object newcdr) | 647 | (register Lisp_Object cell, Lisp_Object newcdr) |
| 656 | { | 648 | { |
| 657 | CHECK_CONS (cell); | 649 | CHECK_CONS (cell); |
| 658 | CHECK_IMPURE (cell, XCONS (cell)); | ||
| 659 | XSETCDR (cell, newcdr); | 650 | XSETCDR (cell, newcdr); |
| 660 | return newcdr; | 651 | return newcdr; |
| 661 | } | 652 | } |
| @@ -943,10 +934,6 @@ The return value is undefined. */) | |||
| 943 | (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring) | 934 | (register Lisp_Object symbol, Lisp_Object definition, Lisp_Object docstring) |
| 944 | { | 935 | { |
| 945 | CHECK_SYMBOL (symbol); | 936 | CHECK_SYMBOL (symbol); |
| 946 | if (!NILP (Vpurify_flag) | ||
| 947 | /* If `definition' is a keymap, immutable (and copying) is wrong. */ | ||
| 948 | && !KEYMAPP (definition)) | ||
| 949 | definition = Fpurecopy (definition); | ||
| 950 | 937 | ||
| 951 | defalias (symbol, definition); | 938 | defalias (symbol, definition); |
| 952 | 939 | ||
| @@ -2590,7 +2577,6 @@ bool-vector. IDX starts at 0. */) | |||
| 2590 | 2577 | ||
| 2591 | if (VECTORP (array)) | 2578 | if (VECTORP (array)) |
| 2592 | { | 2579 | { |
| 2593 | CHECK_IMPURE (array, XVECTOR (array)); | ||
| 2594 | if (idxval < 0 || idxval >= ASIZE (array)) | 2580 | if (idxval < 0 || idxval >= ASIZE (array)) |
| 2595 | args_out_of_range (array, idx); | 2581 | args_out_of_range (array, idx); |
| 2596 | ASET (array, idxval, newelt); | 2582 | ASET (array, idxval, newelt); |
| @@ -2614,7 +2600,6 @@ bool-vector. IDX starts at 0. */) | |||
| 2614 | } | 2600 | } |
| 2615 | else /* STRINGP */ | 2601 | else /* STRINGP */ |
| 2616 | { | 2602 | { |
| 2617 | CHECK_IMPURE (array, XSTRING (array)); | ||
| 2618 | if (idxval < 0 || idxval >= SCHARS (array)) | 2603 | if (idxval < 0 || idxval >= SCHARS (array)) |
| 2619 | args_out_of_range (array, idx); | 2604 | args_out_of_range (array, idx); |
| 2620 | CHECK_CHARACTER (newelt); | 2605 | CHECK_CHARACTER (newelt); |
| @@ -4143,7 +4128,7 @@ syms_of_data (void) | |||
| 4143 | 4128 | ||
| 4144 | DEFSYM (Qcdr, "cdr"); | 4129 | DEFSYM (Qcdr, "cdr"); |
| 4145 | 4130 | ||
| 4146 | error_tail = pure_cons (Qerror, Qnil); | 4131 | error_tail = Fcons (Qerror, Qnil); |
| 4147 | 4132 | ||
| 4148 | /* ERROR is used as a signaler for random errors for which nothing else is | 4133 | /* ERROR is used as a signaler for random errors for which nothing else is |
| 4149 | right. */ | 4134 | right. */ |
| @@ -4151,14 +4136,14 @@ syms_of_data (void) | |||
| 4151 | Fput (Qerror, Qerror_conditions, | 4136 | Fput (Qerror, Qerror_conditions, |
| 4152 | error_tail); | 4137 | error_tail); |
| 4153 | Fput (Qerror, Qerror_message, | 4138 | Fput (Qerror, Qerror_message, |
| 4154 | build_pure_c_string ("error")); | 4139 | build_string ("error")); |
| 4155 | 4140 | ||
| 4156 | #define PUT_ERROR(sym, tail, msg) \ | 4141 | #define PUT_ERROR(sym, tail, msg) \ |
| 4157 | Fput (sym, Qerror_conditions, pure_cons (sym, tail)); \ | 4142 | Fput (sym, Qerror_conditions, Fcons (sym, tail)); \ |
| 4158 | Fput (sym, Qerror_message, build_pure_c_string (msg)) | 4143 | Fput (sym, Qerror_message, build_string (msg)) |
| 4159 | 4144 | ||
| 4160 | PUT_ERROR (Qquit, Qnil, "Quit"); | 4145 | PUT_ERROR (Qquit, Qnil, "Quit"); |
| 4161 | PUT_ERROR (Qminibuffer_quit, pure_cons (Qquit, Qnil), "Quit"); | 4146 | PUT_ERROR (Qminibuffer_quit, Fcons (Qquit, Qnil), "Quit"); |
| 4162 | 4147 | ||
| 4163 | PUT_ERROR (Quser_error, error_tail, ""); | 4148 | PUT_ERROR (Quser_error, error_tail, ""); |
| 4164 | PUT_ERROR (Qwrong_length_argument, error_tail, "Wrong length argument"); | 4149 | PUT_ERROR (Qwrong_length_argument, error_tail, "Wrong length argument"); |
| @@ -4184,14 +4169,14 @@ syms_of_data (void) | |||
| 4184 | PUT_ERROR (Qno_catch, error_tail, "No catch for tag"); | 4169 | PUT_ERROR (Qno_catch, error_tail, "No catch for tag"); |
| 4185 | PUT_ERROR (Qend_of_file, error_tail, "End of file during parsing"); | 4170 | PUT_ERROR (Qend_of_file, error_tail, "End of file during parsing"); |
| 4186 | 4171 | ||
| 4187 | arith_tail = pure_cons (Qarith_error, error_tail); | 4172 | arith_tail = Fcons (Qarith_error, error_tail); |
| 4188 | Fput (Qarith_error, Qerror_conditions, arith_tail); | 4173 | Fput (Qarith_error, Qerror_conditions, arith_tail); |
| 4189 | Fput (Qarith_error, Qerror_message, build_pure_c_string ("Arithmetic error")); | 4174 | Fput (Qarith_error, Qerror_message, build_string ("Arithmetic error")); |
| 4190 | 4175 | ||
| 4191 | PUT_ERROR (Qbeginning_of_buffer, error_tail, "Beginning of buffer"); | 4176 | PUT_ERROR (Qbeginning_of_buffer, error_tail, "Beginning of buffer"); |
| 4192 | PUT_ERROR (Qend_of_buffer, error_tail, "End of buffer"); | 4177 | PUT_ERROR (Qend_of_buffer, error_tail, "End of buffer"); |
| 4193 | PUT_ERROR (Qbuffer_read_only, error_tail, "Buffer is read-only"); | 4178 | PUT_ERROR (Qbuffer_read_only, error_tail, "Buffer is read-only"); |
| 4194 | PUT_ERROR (Qtext_read_only, pure_cons (Qbuffer_read_only, error_tail), | 4179 | PUT_ERROR (Qtext_read_only, Fcons (Qbuffer_read_only, error_tail), |
| 4195 | "Text is read-only"); | 4180 | "Text is read-only"); |
| 4196 | PUT_ERROR (Qinhibited_interaction, error_tail, | 4181 | PUT_ERROR (Qinhibited_interaction, error_tail, |
| 4197 | "User interaction while inhibited"); | 4182 | "User interaction while inhibited"); |
| @@ -4214,10 +4199,10 @@ syms_of_data (void) | |||
| 4214 | PUT_ERROR (Qunderflow_error, Fcons (Qrange_error, arith_tail), | 4199 | PUT_ERROR (Qunderflow_error, Fcons (Qrange_error, arith_tail), |
| 4215 | "Arithmetic underflow error"); | 4200 | "Arithmetic underflow error"); |
| 4216 | 4201 | ||
| 4217 | recursion_tail = pure_cons (Qrecursion_error, error_tail); | 4202 | recursion_tail = Fcons (Qrecursion_error, error_tail); |
| 4218 | Fput (Qrecursion_error, Qerror_conditions, recursion_tail); | 4203 | Fput (Qrecursion_error, Qerror_conditions, recursion_tail); |
| 4219 | Fput (Qrecursion_error, Qerror_message, build_pure_c_string | 4204 | Fput (Qrecursion_error, Qerror_message, |
| 4220 | ("Excessive recursive calling error")); | 4205 | build_string ("Excessive recursive calling error")); |
| 4221 | 4206 | ||
| 4222 | PUT_ERROR (Qexcessive_variable_binding, recursion_tail, | 4207 | PUT_ERROR (Qexcessive_variable_binding, recursion_tail, |
| 4223 | "Variable binding depth exceeds max-specpdl-size"); | 4208 | "Variable binding depth exceeds max-specpdl-size"); |