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/puresize.h | |
| 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/puresize.h')
| -rw-r--r-- | src/puresize.h | 115 |
1 files changed, 0 insertions, 115 deletions
diff --git a/src/puresize.h b/src/puresize.h deleted file mode 100644 index 5516747ac2b..00000000000 --- a/src/puresize.h +++ /dev/null | |||
| @@ -1,115 +0,0 @@ | |||
| 1 | /* How much read-only Lisp storage a dumped Emacs needs. | ||
| 2 | Copyright (C) 1993, 2001-2022 Free Software Foundation, Inc. | ||
| 3 | |||
| 4 | This file is part of GNU Emacs. | ||
| 5 | |||
| 6 | GNU Emacs is free software: you can redistribute it and/or modify | ||
| 7 | it under the terms of the GNU General Public License as published by | ||
| 8 | the Free Software Foundation, either version 3 of the License, or (at | ||
| 9 | your option) any later version. | ||
| 10 | |||
| 11 | GNU Emacs is distributed in the hope that it will be useful, | ||
| 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 14 | GNU General Public License for more details. | ||
| 15 | |||
| 16 | You should have received a copy of the GNU General Public License | ||
| 17 | along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | ||
| 18 | |||
| 19 | #ifndef EMACS_PURESIZE_H | ||
| 20 | #define EMACS_PURESIZE_H | ||
| 21 | |||
| 22 | #include "lisp.h" | ||
| 23 | |||
| 24 | INLINE_HEADER_BEGIN | ||
| 25 | |||
| 26 | /* Define PURESIZE, the number of bytes of pure Lisp code to leave space for. | ||
| 27 | |||
| 28 | At one point, this was defined in config.h, meaning that changing | ||
| 29 | PURESIZE would make Make recompile all of Emacs. But only a few | ||
| 30 | files actually use PURESIZE, so we split it out to its own .h file. | ||
| 31 | |||
| 32 | Make sure to include this file after config.h, since that tells us | ||
| 33 | whether we are running X windows, which tells us how much pure | ||
| 34 | storage to allocate. */ | ||
| 35 | |||
| 36 | /* First define a measure of the amount of data we have. */ | ||
| 37 | |||
| 38 | /* A system configuration file may set this to request a certain extra | ||
| 39 | amount of storage. This is a lot more update-robust that defining | ||
| 40 | BASE_PURESIZE or even PURESIZE directly. */ | ||
| 41 | #ifndef SYSTEM_PURESIZE_EXTRA | ||
| 42 | #define SYSTEM_PURESIZE_EXTRA 0 | ||
| 43 | #endif | ||
| 44 | |||
| 45 | #ifndef SITELOAD_PURESIZE_EXTRA | ||
| 46 | #define SITELOAD_PURESIZE_EXTRA 0 | ||
| 47 | #endif | ||
| 48 | |||
| 49 | #ifndef BASE_PURESIZE | ||
| 50 | #define BASE_PURESIZE (2000000 + SYSTEM_PURESIZE_EXTRA + SITELOAD_PURESIZE_EXTRA) | ||
| 51 | #endif | ||
| 52 | |||
| 53 | /* Increase BASE_PURESIZE by a ratio depending on the machine's word size. */ | ||
| 54 | #ifndef PURESIZE_RATIO | ||
| 55 | #if EMACS_INT_MAX >> 31 != 0 | ||
| 56 | #if PTRDIFF_MAX >> 31 != 0 | ||
| 57 | #define PURESIZE_RATIO 10 / 6 /* Don't surround with `()'. */ | ||
| 58 | #else | ||
| 59 | #define PURESIZE_RATIO 8 / 6 /* Don't surround with `()'. */ | ||
| 60 | #endif | ||
| 61 | #else | ||
| 62 | #define PURESIZE_RATIO 1 | ||
| 63 | #endif | ||
| 64 | #endif | ||
| 65 | |||
| 66 | #ifdef ENABLE_CHECKING | ||
| 67 | /* ENABLE_CHECKING somehow increases the purespace used, probably because | ||
| 68 | it tends to cause some macro arguments to be evaluated twice. This is | ||
| 69 | a bug, but it's difficult to track it down. */ | ||
| 70 | #define PURESIZE_CHECKING_RATIO 12 / 10 /* Don't surround with `()'. */ | ||
| 71 | #else | ||
| 72 | #define PURESIZE_CHECKING_RATIO 1 | ||
| 73 | #endif | ||
| 74 | |||
| 75 | /* This is the actual size in bytes to allocate. */ | ||
| 76 | #ifndef PURESIZE | ||
| 77 | #define PURESIZE (BASE_PURESIZE * PURESIZE_RATIO * PURESIZE_CHECKING_RATIO) | ||
| 78 | #endif | ||
| 79 | |||
| 80 | extern AVOID pure_write_error (Lisp_Object); | ||
| 81 | |||
| 82 | extern EMACS_INT pure[]; | ||
| 83 | |||
| 84 | /* The puresize_h_* macros are private to this include file. */ | ||
| 85 | |||
| 86 | /* True if PTR is pure. */ | ||
| 87 | |||
| 88 | #define puresize_h_PURE_P(ptr) \ | ||
| 89 | ((uintptr_t) (ptr) - (uintptr_t) pure <= PURESIZE) | ||
| 90 | |||
| 91 | INLINE bool | ||
| 92 | PURE_P (void *ptr) | ||
| 93 | { | ||
| 94 | return puresize_h_PURE_P (ptr); | ||
| 95 | } | ||
| 96 | |||
| 97 | /* Signal an error if OBJ is pure. PTR is OBJ untagged. */ | ||
| 98 | |||
| 99 | #define puresize_h_CHECK_IMPURE(obj, ptr) \ | ||
| 100 | (PURE_P (ptr) ? pure_write_error (obj) : (void) 0) | ||
| 101 | |||
| 102 | INLINE void | ||
| 103 | CHECK_IMPURE (Lisp_Object obj, void *ptr) | ||
| 104 | { | ||
| 105 | puresize_h_CHECK_IMPURE (obj, ptr); | ||
| 106 | } | ||
| 107 | |||
| 108 | #if DEFINE_KEY_OPS_AS_MACROS | ||
| 109 | # define PURE_P(ptr) puresize_h_PURE_P (ptr) | ||
| 110 | # define CHECK_IMPURE(obj, ptr) puresize_h_CHECK_IMPURE (obj, ptr) | ||
| 111 | #endif | ||
| 112 | |||
| 113 | INLINE_HEADER_END | ||
| 114 | |||
| 115 | #endif /* EMACS_PURESIZE_H */ | ||