diff options
author | Pip Cet <pipcet@gmail.com> | 2021-05-16 15:44:26 +0200 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2022-07-01 18:59:35 -0400 |
commit | b6a526361b57f8d9f6d5078ccd97832d0a1fb036 (patch) | |
tree | 0c752a1c74920a2b731bb2e3c2ff6623be240a72 /src/lread.c | |
parent | 3daf833ff3f3e99b44731808cb197c0912649997 (diff) | |
download | emacs-scratch/no-purespace.tar.gz |
Remove purespace and ancillary codescratch/no-purespace
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.c | 76 |
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. */) } if (! NILP (Vpurify_flag)) - Vpreloaded_file_list = Fcons (Fpurecopy (file), Vpreloaded_file_list); + Vpreloaded_file_list = Fcons (file, Vpreloaded_file_list); if (NILP (nomessage) || force_load_messages) { @@ -2288,36 +2288,32 @@ readevalloop (Lisp_Object readcharfun, read_objects_map = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, DEFAULT_REHASH_SIZE, DEFAULT_REHASH_THRESHOLD, - Qnil, false); + Qnil); if (! HASH_TABLE_P (read_objects_completed) || XHASH_TABLE (read_objects_completed)->count) read_objects_completed = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, DEFAULT_REHASH_SIZE, DEFAULT_REHASH_THRESHOLD, - Qnil, false); - if (!NILP (Vpurify_flag) && c == '(') - val = read0 (readcharfun, false); - else + Qnil); + if (!NILP (readfun)) { - if (!NILP (readfun)) - { - val = call1 (readfun, readcharfun); + val = call1 (readfun, readcharfun); - /* If READCHARFUN has set point to ZV, we should + /* If READCHARFUN has set point to ZV, we should stop reading, even if the form read sets point to a different value when evaluated. */ - if (BUFFERP (readcharfun)) - { - struct buffer *buf = XBUFFER (readcharfun); - if (BUF_PT (buf) == BUF_ZV (buf)) - continue_reading_p = 0; - } + if (BUFFERP (readcharfun)) + { + struct buffer *buf = XBUFFER (readcharfun); + if (BUF_PT (buf) == BUF_ZV (buf)) + continue_reading_p = 0; } - else if (! NILP (Vload_read_function)) - val = call1 (Vload_read_function, readcharfun); - else - val = read_internal_start (readcharfun, Qnil, Qnil, false); } + else if (! NILP (Vload_read_function)) + val = call1 (Vload_read_function, readcharfun); + else + val = read_internal_start (readcharfun, Qnil, Qnil, false); + /* Empty hashes can be reused; otherwise, reset on next call. */ if (HASH_TABLE_P (read_objects_map) && XHASH_TABLE (read_objects_map)->count > 0) @@ -2539,12 +2535,12 @@ read_internal_start (Lisp_Object stream, Lisp_Object start, Lisp_Object end, || XHASH_TABLE (read_objects_map)->count) read_objects_map = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, DEFAULT_REHASH_SIZE, - DEFAULT_REHASH_THRESHOLD, Qnil, false); + DEFAULT_REHASH_THRESHOLD, Qnil); if (! HASH_TABLE_P (read_objects_completed) || XHASH_TABLE (read_objects_completed)->count) read_objects_completed = make_hash_table (hashtest_eq, DEFAULT_HASH_SIZE, DEFAULT_REHASH_SIZE, - DEFAULT_REHASH_THRESHOLD, Qnil, false); + DEFAULT_REHASH_THRESHOLD, Qnil); if (STRINGP (stream) || ((CONSP (stream) && STRINGP (XCAR (stream))))) @@ -4150,10 +4146,7 @@ read0 (Lisp_Object readcharfun, bool locate_syms) if (uninterned_symbol) { Lisp_Object name - = (!NILP (Vpurify_flag) - ? make_pure_string (read_buffer, nchars, nbytes, multibyte) - : make_specified_string (read_buffer, nchars, nbytes, - multibyte)); + = make_specified_string (read_buffer, nchars, nbytes, multibyte); result = Fmake_symbol (name); } else @@ -4645,16 +4638,8 @@ intern_c_string_1 (const char *str, ptrdiff_t len) Lisp_Object tem = oblookup (obarray, str, len, len); if (!SYMBOLP (tem)) - { - Lisp_Object string; + tem = intern_driver (make_string (str, len), obarray, tem); - if (NILP (Vpurify_flag)) - string = make_string (str, len); - else - string = make_pure_c_string (str, len); - - tem = intern_driver (string, obarray, tem); - } return tem; } @@ -4662,7 +4647,7 @@ static void define_symbol (Lisp_Object sym, char const *str) { ptrdiff_t len = strlen (str); - Lisp_Object string = make_pure_c_string (str, len); + Lisp_Object string = make_string (str, len); init_symbol (sym, string); /* Qunbound is uninterned, so that it's not confused with any symbol @@ -4706,8 +4691,7 @@ it defaults to the value of `obarray'. */) xfree (longhand); } else - tem = intern_driver (NILP (Vpurify_flag) ? string : Fpurecopy (string), - obarray, tem); + tem = intern_driver (string, obarray, tem); } return tem; } @@ -5002,7 +4986,7 @@ init_obarray_once (void) XSYMBOL (Qt)->u.s.declared_special = true; /* Qt is correct even if not dumping. loadup.el will set to nil at end. */ - Vpurify_flag = Qt; + Vpurify_flag = Qt; /* FIXME: Redundant with setting in alloc.c. */ DEFSYM (Qvariable_documentation, "variable-documentation"); } @@ -5019,7 +5003,7 @@ defsubr (union Aligned_Lisp_Subr *aname) set_symbol_function (sym, tem); #ifdef HAVE_NATIVE_COMP eassert (NILP (Vcomp_abi_hash)); - Vcomp_subr_list = Fpurecopy (Fcons (tem, Vcomp_subr_list)); + Vcomp_subr_list = Fcons (tem, Vcomp_subr_list); #endif } @@ -5412,20 +5396,20 @@ This list includes suffixes for both compiled and source Emacs Lisp files. This list should not include the empty string. `load' and related functions try to append these suffixes, in order, to the specified file name if a suffix is allowed or required. */); - Vload_suffixes = list2 (build_pure_c_string (".elc"), - build_pure_c_string (".el")); + Vload_suffixes = list2 (build_string (".elc"), + build_string (".el")); #ifdef HAVE_MODULES - Vload_suffixes = Fcons (build_pure_c_string (MODULES_SUFFIX), Vload_suffixes); + Vload_suffixes = Fcons (build_string (MODULES_SUFFIX), Vload_suffixes); #ifdef MODULES_SECONDARY_SUFFIX Vload_suffixes = - Fcons (build_pure_c_string (MODULES_SECONDARY_SUFFIX), Vload_suffixes); + Fcons (build_string (MODULES_SECONDARY_SUFFIX), Vload_suffixes); #endif #endif DEFVAR_LISP ("module-file-suffix", Vmodule_file_suffix, doc: /* Suffix of loadable module file, or nil if modules are not supported. */); #ifdef HAVE_MODULES - Vmodule_file_suffix = build_pure_c_string (MODULES_SUFFIX); + Vmodule_file_suffix = build_string (MODULES_SUFFIX); #else Vmodule_file_suffix = Qnil; #endif @@ -5575,7 +5559,7 @@ from the file, and matches them against this regular expression. When the regular expression matches, the file is considered to be safe to load. */); Vbytecomp_version_regexp - = build_pure_c_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)"); + = build_string ("^;;;.\\(in Emacs version\\|bytecomp version FSF\\)"); DEFSYM (Qlexical_binding, "lexical-binding"); DEFVAR_LISP ("lexical-binding", Vlexical_binding, |