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/fns.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/fns.c')
| -rw-r--r-- | src/fns.c | 33 |
1 files changed, 6 insertions, 27 deletions
| @@ -36,7 +36,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 36 | #include "buffer.h" | 36 | #include "buffer.h" |
| 37 | #include "intervals.h" | 37 | #include "intervals.h" |
| 38 | #include "window.h" | 38 | #include "window.h" |
| 39 | #include "puresize.h" | ||
| 40 | #include "gnutls.h" | 39 | #include "gnutls.h" |
| 41 | 40 | ||
| 42 | enum equal_kind { EQUAL_NO_QUIT, EQUAL_PLAIN, EQUAL_INCLUDING_PROPERTIES }; | 41 | enum equal_kind { EQUAL_NO_QUIT, EQUAL_PLAIN, EQUAL_INCLUDING_PROPERTIES }; |
| @@ -2653,7 +2652,6 @@ ARRAY is a vector, string, char-table, or bool-vector. */) | |||
| 2653 | size = SCHARS (array); | 2652 | size = SCHARS (array); |
| 2654 | if (size != 0) | 2653 | if (size != 0) |
| 2655 | { | 2654 | { |
| 2656 | CHECK_IMPURE (array, XSTRING (array)); | ||
| 2657 | unsigned char str[MAX_MULTIBYTE_LENGTH]; | 2655 | unsigned char str[MAX_MULTIBYTE_LENGTH]; |
| 2658 | int len; | 2656 | int len; |
| 2659 | if (STRING_MULTIBYTE (array)) | 2657 | if (STRING_MULTIBYTE (array)) |
| @@ -2695,7 +2693,6 @@ This makes STRING unibyte and may change its length. */) | |||
| 2695 | ptrdiff_t len = SBYTES (string); | 2693 | ptrdiff_t len = SBYTES (string); |
| 2696 | if (len != 0 || STRING_MULTIBYTE (string)) | 2694 | if (len != 0 || STRING_MULTIBYTE (string)) |
| 2697 | { | 2695 | { |
| 2698 | CHECK_IMPURE (string, XSTRING (string)); | ||
| 2699 | memset (SDATA (string), 0, len); | 2696 | memset (SDATA (string), 0, len); |
| 2700 | STRING_SET_CHARS (string, len); | 2697 | STRING_SET_CHARS (string, len); |
| 2701 | STRING_SET_UNIBYTE (string); | 2698 | STRING_SET_UNIBYTE (string); |
| @@ -4263,16 +4260,12 @@ hash_index_size (struct Lisp_Hash_Table *h, ptrdiff_t size) | |||
| 4263 | size exceeds REHASH_THRESHOLD. | 4260 | size exceeds REHASH_THRESHOLD. |
| 4264 | 4261 | ||
| 4265 | WEAK specifies the weakness of the table. If non-nil, it must be | 4262 | WEAK specifies the weakness of the table. If non-nil, it must be |
| 4266 | one of the symbols `key', `value', `key-or-value', or `key-and-value'. | 4263 | one of the symbols `key', `value', `key-or-value', or `key-and-value'. */ |
| 4267 | |||
| 4268 | If PURECOPY is non-nil, the table can be copied to pure storage via | ||
| 4269 | `purecopy' when Emacs is being dumped. Such tables can no longer be | ||
| 4270 | changed after purecopy. */ | ||
| 4271 | 4264 | ||
| 4272 | Lisp_Object | 4265 | Lisp_Object |
| 4273 | make_hash_table (struct hash_table_test test, EMACS_INT size, | 4266 | make_hash_table (struct hash_table_test test, EMACS_INT size, |
| 4274 | float rehash_size, float rehash_threshold, | 4267 | float rehash_size, float rehash_threshold, |
| 4275 | Lisp_Object weak, bool purecopy) | 4268 | Lisp_Object weak) |
| 4276 | { | 4269 | { |
| 4277 | struct Lisp_Hash_Table *h; | 4270 | struct Lisp_Hash_Table *h; |
| 4278 | Lisp_Object table; | 4271 | Lisp_Object table; |
| @@ -4301,7 +4294,6 @@ make_hash_table (struct hash_table_test test, EMACS_INT size, | |||
| 4301 | h->next = make_vector (size, make_fixnum (-1)); | 4294 | h->next = make_vector (size, make_fixnum (-1)); |
| 4302 | h->index = make_vector (hash_index_size (h, size), make_fixnum (-1)); | 4295 | h->index = make_vector (hash_index_size (h, size), make_fixnum (-1)); |
| 4303 | h->next_weak = NULL; | 4296 | h->next_weak = NULL; |
| 4304 | h->purecopy = purecopy; | ||
| 4305 | h->mutable = true; | 4297 | h->mutable = true; |
| 4306 | 4298 | ||
| 4307 | /* Set up the free list. */ | 4299 | /* Set up the free list. */ |
| @@ -4402,11 +4394,6 @@ maybe_resize_hash_table (struct Lisp_Hash_Table *h) | |||
| 4402 | set_hash_next_slot (h, i, HASH_INDEX (h, start_of_bucket)); | 4394 | set_hash_next_slot (h, i, HASH_INDEX (h, start_of_bucket)); |
| 4403 | set_hash_index_slot (h, start_of_bucket, i); | 4395 | set_hash_index_slot (h, start_of_bucket, i); |
| 4404 | } | 4396 | } |
| 4405 | |||
| 4406 | #ifdef ENABLE_CHECKING | ||
| 4407 | if (HASH_TABLE_P (Vpurify_flag) && XHASH_TABLE (Vpurify_flag) == h) | ||
| 4408 | message ("Growing hash table to: %"pD"d", next_size); | ||
| 4409 | #endif | ||
| 4410 | } | 4397 | } |
| 4411 | } | 4398 | } |
| 4412 | 4399 | ||
| @@ -4470,7 +4457,6 @@ check_mutable_hash_table (Lisp_Object obj, struct Lisp_Hash_Table *h) | |||
| 4470 | { | 4457 | { |
| 4471 | if (!h->mutable) | 4458 | if (!h->mutable) |
| 4472 | signal_error ("hash table test modifies table", obj); | 4459 | signal_error ("hash table test modifies table", obj); |
| 4473 | eassert (!PURE_P (h)); | ||
| 4474 | } | 4460 | } |
| 4475 | 4461 | ||
| 4476 | static void | 4462 | static void |
| @@ -4998,16 +4984,10 @@ key, value, one of key or value, or both key and value, depending on | |||
| 4998 | WEAK. WEAK t is equivalent to `key-and-value'. Default value of WEAK | 4984 | WEAK. WEAK t is equivalent to `key-and-value'. Default value of WEAK |
| 4999 | is nil. | 4985 | is nil. |
| 5000 | 4986 | ||
| 5001 | :purecopy PURECOPY -- If PURECOPY is non-nil, the table can be copied | ||
| 5002 | to pure storage when Emacs is being dumped, making the contents of the | ||
| 5003 | table read only. Any further changes to purified tables will result | ||
| 5004 | in an error. | ||
| 5005 | |||
| 5006 | usage: (make-hash-table &rest KEYWORD-ARGS) */) | 4987 | usage: (make-hash-table &rest KEYWORD-ARGS) */) |
| 5007 | (ptrdiff_t nargs, Lisp_Object *args) | 4988 | (ptrdiff_t nargs, Lisp_Object *args) |
| 5008 | { | 4989 | { |
| 5009 | Lisp_Object test, weak; | 4990 | Lisp_Object test, weak; |
| 5010 | bool purecopy; | ||
| 5011 | struct hash_table_test testdesc; | 4991 | struct hash_table_test testdesc; |
| 5012 | ptrdiff_t i; | 4992 | ptrdiff_t i; |
| 5013 | USE_SAFE_ALLOCA; | 4993 | USE_SAFE_ALLOCA; |
| @@ -5041,9 +5021,9 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */) | |||
| 5041 | testdesc.cmpfn = cmpfn_user_defined; | 5021 | testdesc.cmpfn = cmpfn_user_defined; |
| 5042 | } | 5022 | } |
| 5043 | 5023 | ||
| 5044 | /* See if there's a `:purecopy PURECOPY' argument. */ | 5024 | /* Ignore a `:purecopy PURECOPY' argument. We used to accept those, but |
| 5045 | i = get_key_arg (QCpurecopy, nargs, args, used); | 5025 | they were only meaningful when we had the purespace. */ |
| 5046 | purecopy = i && !NILP (args[i]); | 5026 | get_key_arg (QCpurecopy, nargs, args, used); |
| 5047 | /* See if there's a `:size SIZE' argument. */ | 5027 | /* See if there's a `:size SIZE' argument. */ |
| 5048 | i = get_key_arg (QCsize, nargs, args, used); | 5028 | i = get_key_arg (QCsize, nargs, args, used); |
| 5049 | Lisp_Object size_arg = i ? args[i] : Qnil; | 5029 | Lisp_Object size_arg = i ? args[i] : Qnil; |
| @@ -5093,8 +5073,7 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */) | |||
| 5093 | signal_error ("Invalid argument list", args[i]); | 5073 | signal_error ("Invalid argument list", args[i]); |
| 5094 | 5074 | ||
| 5095 | SAFE_FREE (); | 5075 | SAFE_FREE (); |
| 5096 | return make_hash_table (testdesc, size, rehash_size, rehash_threshold, weak, | 5076 | return make_hash_table (testdesc, size, rehash_size, rehash_threshold, weak); |
| 5097 | purecopy); | ||
| 5098 | } | 5077 | } |
| 5099 | 5078 | ||
| 5100 | 5079 | ||