aboutsummaryrefslogtreecommitdiffstats
path: root/src/lread.c
diff options
context:
space:
mode:
authorPip Cet2021-05-16 15:44:26 +0200
committerStefan Monnier2022-07-01 18:59:35 -0400
commitb6a526361b57f8d9f6d5078ccd97832d0a1fb036 (patch)
tree0c752a1c74920a2b731bb2e3c2ff6623be240a72 /src/lread.c
parent3daf833ff3f3e99b44731808cb197c0912649997 (diff)
downloademacs-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/lread.c')
-rw-r--r--src/lread.c76
1 files changed, 30 insertions, 46 deletions
diff --git a/src/lread.c b/src/lread.c
index 66b13916465..ada20810c3a 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1537,7 +1537,7 @@ Return t if the file exists and loads successfully. */)
1537 } 1537 }
1538 1538
1539 if (! NILP (Vpurify_flag)) 1539 if (! NILP (Vpurify_flag))
1540 Vpreloaded_file_list = Fcons (Fpurecopy (file), Vpreloaded_file_list); 1540 Vpreloaded_file_list = Fcons (file, Vpreloaded_file_list);
1541 1541
1542 if (NILP (nomessage) || force_load_messages) 1542 if (NILP (nomessage) || force_load_messages)
1543 { 1543 {
@@ -2288,36 +2288,32 @@ readevalloop (Lisp_Object readcharfun,
2288 read_objects_map 2288 read_objects_map
2289 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, 2289 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE,
2290 DEFAULT_REHASH_SIZE, DEFAULT_REHASH_THRESHOLD, 2290 DEFAULT_REHASH_SIZE, DEFAULT_REHASH_THRESHOLD,
2291 Qnil, false); 2291 Qnil);
2292 if (! HASH_TABLE_P (read_objects_completed) 2292 if (! HASH_TABLE_P (read_objects_completed)
2293 || XHASH_TABLE (read_objects_completed)->count) 2293 || XHASH_TABLE (read_objects_completed)->count)
2294 read_objects_completed 2294 read_objects_completed
2295 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, 2295 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE,
2296 DEFAULT_REHASH_SIZE, DEFAULT_REHASH_THRESHOLD, 2296 DEFAULT_REHASH_SIZE, DEFAULT_REHASH_THRESHOLD,
2297 Qnil, false); 2297 Qnil);
2298 if (!NILP (Vpurify_flag) && c == '(') 2298 if (!NILP (readfun))
2299 val = read0 (readcharfun, false);
2300 else
2301 { 2299 {
2302 if (!NILP (readfun)) 2300 val = call1 (readfun, readcharfun);
2303 {
2304 val = call1 (readfun, readcharfun);
2305 2301
2306 /* If READCHARFUN has set point to ZV, we should 2302 /* If READCHARFUN has set point to ZV, we should
2307 stop reading, even if the form read sets point 2303 stop reading, even if the form read sets point
2308 to a different value when evaluated. */ 2304 to a different value when evaluated. */
2309 if (BUFFERP (readcharfun)) 2305 if (BUFFERP (readcharfun))
2310 { 2306 {
2311 struct buffer *buf = XBUFFER (readcharfun); 2307 struct buffer *buf = XBUFFER (readcharfun);
2312 if (BUF_PT (buf) == BUF_ZV (buf)) 2308 if (BUF_PT (buf) == BUF_ZV (buf))
2313 continue_reading_p = 0; 2309 continue_reading_p = 0;
2314 }
2315 } 2310 }
2316 else if (! NILP (Vload_read_function))
2317 val = call1 (Vload_read_function, readcharfun);
2318 else
2319 val = read_internal_start (readcharfun, Qnil, Qnil, false);
2320 } 2311 }
2312 else if (! NILP (Vload_read_function))
2313 val = call1 (Vload_read_function, readcharfun);
2314 else
2315 val = read_internal_start (readcharfun, Qnil, Qnil, false);
2316
2321 /* Empty hashes can be reused; otherwise, reset on next call. */ 2317 /* Empty hashes can be reused; otherwise, reset on next call. */
2322 if (HASH_TABLE_P (read_objects_map) 2318 if (HASH_TABLE_P (read_objects_map)
2323 && XHASH_TABLE (read_objects_map)->count > 0) 2319 && XHASH_TABLE (read_objects_map)->count > 0)
@@ -2539,12 +2535,12 @@ read_internal_start (Lisp_Object stream, Lisp_Object start, Lisp_Object end,
2539 || XHASH_TABLE (read_objects_map)->count) 2535 || XHASH_TABLE (read_objects_map)->count)
2540 read_objects_map 2536 read_objects_map
2541 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, DEFAULT_REHASH_SIZE, 2537 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, DEFAULT_REHASH_SIZE,
2542 DEFAULT_REHASH_THRESHOLD, Qnil, false); 2538 DEFAULT_REHASH_THRESHOLD, Qnil);
2543 if (! HASH_TABLE_P (read_objects_completed) 2539 if (! HASH_TABLE_P (read_objects_completed)
2544 || XHASH_TABLE (read_objects_completed)->count) 2540 || XHASH_TABLE (read_objects_completed)->count)
2545 read_objects_completed 2541 read_objects_completed
2546 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, DEFAULT_REHASH_SIZE, 2542 = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, DEFAULT_REHASH_SIZE,
2547 DEFAULT_REHASH_THRESHOLD, Qnil, false); 2543 DEFAULT_REHASH_THRESHOLD, Qnil);
2548 2544
2549 if (STRINGP (stream) 2545 if (STRINGP (stream)
2550 || ((CONSP (stream) && STRINGP (XCAR (stream))))) 2546 || ((CONSP (stream) && STRINGP (XCAR (stream)))))
@@ -4150,10 +4146,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms)
4150 if (uninterned_symbol) 4146 if (uninterned_symbol)
4151 { 4147 {
4152 Lisp_Object name 4148 Lisp_Object name
4153 = (!NILP (Vpurify_flag) 4149 = make_specified_string (read_buffer, nchars, nbytes, multibyte);
4154 ? make_pure_string (read_buffer, nchars, nbytes, multibyte)
4155 : make_specified_string (read_buffer, nchars, nbytes,
4156 multibyte));
4157 result = Fmake_symbol (name); 4150 result = Fmake_symbol (name);
4158 } 4151 }
4159 else 4152 else
@@ -4645,16 +4638,8 @@ intern_c_string_1 (const char *str, ptrdiff_t len)
4645 Lisp_Object tem = oblookup (obarray, str, len, len); 4638 Lisp_Object tem = oblookup (obarray, str, len, len);
4646 4639
4647 if (!SYMBOLP (tem)) 4640 if (!SYMBOLP (tem))
4648 { 4641 tem = intern_driver (make_string (str, len), obarray, tem);
4649 Lisp_Object string;
4650 4642
4651 if (NILP (Vpurify_flag))
4652 string = make_string (str, len);
4653 else
4654 string = make_pure_c_string (str, len);
4655
4656 tem = intern_driver (string, obarray, tem);
4657 }
4658 return tem; 4643 return tem;
4659} 4644}
4660 4645
@@ -4662,7 +4647,7 @@ static void
4662define_symbol (Lisp_Object sym, char const *str) 4647define_symbol (Lisp_Object sym, char const *str)
4663{ 4648{
4664 ptrdiff_t len = strlen (str); 4649 ptrdiff_t len = strlen (str);
4665 Lisp_Object string = make_pure_c_string (str, len); 4650 Lisp_Object string = make_string (str, len);
4666 init_symbol (sym, string); 4651 init_symbol (sym, string);
4667 4652
4668 /* Qunbound is uninterned, so that it's not confused with any symbol 4653 /* Qunbound is uninterned, so that it's not confused with any symbol
@@ -4706,8 +4691,7 @@ it defaults to the value of `obarray'. */)
4706 xfree (longhand); 4691 xfree (longhand);
4707 } 4692 }
4708 else 4693 else
4709 tem = intern_driver (NILP (Vpurify_flag) ? string : Fpurecopy (string), 4694 tem = intern_driver (string, obarray, tem);
4710 obarray, tem);
4711 } 4695 }
4712 return tem; 4696 return tem;
4713} 4697}
@@ -5002,7 +4986,7 @@ init_obarray_once (void)
5002 XSYMBOL (Qt)->u.s.declared_special = true; 4986 XSYMBOL (Qt)->u.s.declared_special = true;
5003 4987
5004 /* Qt is correct even if not dumping. loadup.el will set to nil at end. */ 4988 /* Qt is correct even if not dumping. loadup.el will set to nil at end. */
5005 Vpurify_flag = Qt; 4989 Vpurify_flag = Qt; /* FIXME: Redundant with setting in alloc.c. */
5006 4990
5007 DEFSYM (Qvariable_documentation, "variable-documentation"); 4991 DEFSYM (Qvariable_documentation, "variable-documentation");
5008} 4992}
@@ -5019,7 +5003,7 @@ defsubr (union Aligned_Lisp_Subr *aname)
5019 set_symbol_function (sym, tem); 5003 set_symbol_function (sym, tem);
5020#ifdef HAVE_NATIVE_COMP 5004#ifdef HAVE_NATIVE_COMP
5021 eassert (NILP (Vcomp_abi_hash)); 5005 eassert (NILP (Vcomp_abi_hash));
5022 Vcomp_subr_list = Fpurecopy (Fcons (tem, Vcomp_subr_list)); 5006 Vcomp_subr_list = Fcons (tem, Vcomp_subr_list);
5023#endif 5007#endif
5024} 5008}
5025 5009
@@ -5412,20 +5396,20 @@ This list includes suffixes for both compiled and source Emacs Lisp files.
5412This list should not include the empty string. 5396This list should not include the empty string.
5413`load' and related functions try to append these suffixes, in order, 5397`load' and related functions try to append these suffixes, in order,
5414to the specified file name if a suffix is allowed or required. */); 5398to the specified file name if a suffix is allowed or required. */);
5415 Vload_suffixes = list2 (build_pure_c_string (".elc"), 5399 Vload_suffixes = list2 (build_string (".elc"),
5416 build_pure_c_string (".el")); 5400 build_string (".el"));
5417#ifdef HAVE_MODULES 5401#ifdef HAVE_MODULES
5418 Vload_suffixes = Fcons (build_pure_c_string (MODULES_SUFFIX), Vload_suffixes); 5402 Vload_suffixes = Fcons (build_string (MODULES_SUFFIX), Vload_suffixes);
5419#ifdef MODULES_SECONDARY_SUFFIX 5403#ifdef MODULES_SECONDARY_SUFFIX
5420 Vload_suffixes = 5404 Vload_suffixes =
5421 Fcons (build_pure_c_string (MODULES_SECONDARY_SUFFIX), Vload_suffixes); 5405 Fcons (build_string (MODULES_SECONDARY_SUFFIX), Vload_suffixes);
5422#endif 5406#endif
5423 5407
5424#endif 5408#endif
5425 DEFVAR_LISP ("module-file-suffix", Vmodule_file_suffix, 5409 DEFVAR_LISP ("module-file-suffix", Vmodule_file_suffix,
5426 doc: /* Suffix of loadable module file, or nil if modules are not supported. */); 5410 doc: /* Suffix of loadable module file, or nil if modules are not supported. */);
5427#ifdef HAVE_MODULES 5411#ifdef HAVE_MODULES
5428 Vmodule_file_suffix = build_pure_c_string (MODULES_SUFFIX); 5412 Vmodule_file_suffix = build_string (MODULES_SUFFIX);
5429#else 5413#else
5430 Vmodule_file_suffix = Qnil; 5414 Vmodule_file_suffix = Qnil;
5431#endif 5415#endif
@@ -5575,7 +5559,7 @@ from the file, and matches them against this regular expression.
5575When the regular expression matches, the file is considered to be safe 5559When the regular expression matches, the file is considered to be safe
5576to load. */); 5560to load. */);
5577 Vbytecomp_version_regexp 5561 Vbytecomp_version_regexp
5578 = build_pure_c_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)"); 5562 = build_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)");
5579 5563
5580 DEFSYM (Qlexical_binding, "lexical-binding"); 5564 DEFSYM (Qlexical_binding, "lexical-binding");
5581 DEFVAR_LISP ("lexical-binding", Vlexical_binding, 5565 DEFVAR_LISP ("lexical-binding", Vlexical_binding,