[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
scratch/no-purespace 63a8d3cb70f 09/41: Pure storage removal: Remove pur
From: |
Stefan Kangas |
Subject: |
scratch/no-purespace 63a8d3cb70f 09/41: Pure storage removal: Remove purecopy hash table flag |
Date: |
Tue, 10 Dec 2024 19:09:37 -0500 (EST) |
branch: scratch/no-purespace
commit 63a8d3cb70f30d679677dc6cb962c95351ec1bd3
Author: Pip Cet <pipcet@protonmail.com>
Commit: Stefan Kangas <stefankangas@gmail.com>
Pure storage removal: Remove purecopy hash table flag
* lisp/emacs-liqsp/comp.el (comp--jump-table-optimizable): Adjust
comment.
* src/category.c (hash_get_category_set):
* src/emacs-module.c (syms_of_module):
* src/fns.c (make_hash_table): Remove 'purecopy' flag and update
docstring.
(Fmake_hash_table): Ignore ':purecopy' argument.
* src/frame.c (make_frame):
* src/image.c (xpm_make_color_table_h):
* src/json.c (json_parse_object): Adjust calls to 'make_hash_table'.
* src/lisp.h (struct Lisp_Hash_Table): Drop 'purecopy' flag.
* src/lread.c (readevalloop):
(read_internal_start): Adjust calls to 'make_hash_table'.
* src/pdumper.c (dump_hash_table): Don't dump 'purecopy' flag.
* src/pgtkterm.c (syms_of_pgtkterm): Adjust call to 'make_hash_table'.
* src/print.c (print_object): Don't print 'purecopy' flag
* src/profiler.c (export_log):
* src/xfaces.c (syms_of_xfaces):
* src/xterm.c (syms_of_xterm): Adjust calls to 'make_hash_table'.
---
lisp/emacs-lisp/comp.el | 2 +-
src/category.c | 2 +-
src/emacs-module.c | 2 +-
src/fns.c | 28 +++++++---------------------
src/frame.c | 2 +-
src/image.c | 2 +-
src/json.c | 2 +-
src/lisp.h | 6 +-----
src/lread.c | 8 ++++----
src/pdumper.c | 1 -
src/pgtkterm.c | 2 +-
src/print.c | 3 ---
src/profiler.c | 2 +-
src/xfaces.c | 2 +-
src/xterm.c | 2 +-
15 files changed, 22 insertions(+), 44 deletions(-)
diff --git a/lisp/emacs-lisp/comp.el b/lisp/emacs-lisp/comp.el
index 2966ed255ac..aea38c60d41 100644
--- a/lisp/emacs-lisp/comp.el
+++ b/lisp/emacs-lisp/comp.el
@@ -1190,7 +1190,7 @@ Return value is the fall-through block name."
(defun comp--jump-table-optimizable (jmp-table)
"Return t if JMP-TABLE can be optimized out."
;; Identify LAP sequences like:
- ;; (byte-constant #s(hash-table test eq purecopy t data (created 126 deleted
126 changed 126)) . 24)
+ ;; (byte-constant #s(hash-table test eq data (created 126 deleted 126
changed 126)) . 24)
;; (byte-switch)
;; (TAG 126 . 10)
(let ((targets (hash-table-values jmp-table)))
diff --git a/src/category.c b/src/category.c
index ef29a1a681a..85a2ea0ad0f 100644
--- a/src/category.c
+++ b/src/category.c
@@ -51,7 +51,7 @@ hash_get_category_set (Lisp_Object table, Lisp_Object
category_set)
if (NILP (XCHAR_TABLE (table)->extras[1]))
set_char_table_extras
(table, 1,
- make_hash_table (&hashtest_equal, DEFAULT_HASH_SIZE, Weak_None, false));
+ make_hash_table (&hashtest_equal, DEFAULT_HASH_SIZE, Weak_None));
struct Lisp_Hash_Table *h = XHASH_TABLE (XCHAR_TABLE (table)->extras[1]);
hash_hash_t hash;
ptrdiff_t i = hash_lookup_get_hash (h, category_set, &hash);
diff --git a/src/emacs-module.c b/src/emacs-module.c
index d818b6cdeb9..e3a935236ca 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -1709,7 +1709,7 @@ syms_of_module (void)
{
staticpro (&Vmodule_refs_hash);
Vmodule_refs_hash
- = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false);
+ = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None);
DEFSYM (Qmodule_load_failed, "module-load-failed");
Fput (Qmodule_load_failed, Qerror_conditions,
diff --git a/src/fns.c b/src/fns.c
index 75fd20a2d79..7c2ddb8707c 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -4847,15 +4847,11 @@ static const hash_idx_t empty_hash_index_vector[] =
{-1};
Give the table initial capacity SIZE, 0 <= SIZE <= MOST_POSITIVE_FIXNUM.
- WEAK specifies the weakness of the table.
-
- If PURECOPY is non-nil, the table can be copied to pure storage via
- `purecopy' when Emacs is being dumped. Such tables can no longer be
- changed after purecopy. */
+ WEAK specifies the weakness of the table. */
Lisp_Object
make_hash_table (const struct hash_table_test *test, EMACS_INT size,
- hash_table_weakness_t weak, bool purecopy)
+ hash_table_weakness_t weak)
{
eassert (SYMBOLP (test->name));
eassert (0 <= size && size <= min (MOST_POSITIVE_FIXNUM, PTRDIFF_MAX));
@@ -4901,7 +4897,6 @@ make_hash_table (const struct hash_table_test *test,
EMACS_INT size,
}
h->next_weak = NULL;
- h->purecopy = purecopy;
h->mutable = true;
return make_lisp_hash_table (h);
}
@@ -5735,13 +5730,8 @@ key, value, one of key or value, or both key and value,
depending on
WEAK. WEAK t is equivalent to `key-and-value'. Default value of WEAK
is nil.
-:purecopy PURECOPY -- If PURECOPY is non-nil, the table can be copied
-to pure storage when Emacs is being dumped, making the contents of the
-table read only. Any further changes to purified tables will result
-in an error.
-
-The keywords arguments :rehash-threshold and :rehash-size are obsolete
-and ignored.
+The keywords arguments :rehash-threshold, :rehash-size, and :purecopy
+are obsolete and ignored.
usage: (make-hash-table &rest KEYWORD-ARGS) */)
(ptrdiff_t nargs, Lisp_Object *args)
@@ -5749,7 +5739,6 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */)
Lisp_Object test_arg = Qnil;
Lisp_Object weakness_arg = Qnil;
Lisp_Object size_arg = Qnil;
- Lisp_Object purecopy_arg = Qnil;
if (nargs & 1)
error ("Odd number of arguments");
@@ -5763,9 +5752,8 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */)
weakness_arg = arg;
else if (BASE_EQ (kw, QCsize))
size_arg = arg;
- else if (BASE_EQ (kw, QCpurecopy))
- purecopy_arg = arg;
- else if (BASE_EQ (kw, QCrehash_threshold) || BASE_EQ (kw, QCrehash_size))
+ else if (BASE_EQ (kw, QCrehash_threshold) || BASE_EQ (kw, QCrehash_size)
+ || BASE_EQ (kw, QCpurecopy))
; /* ignore obsolete keyword arguments */
else
signal_error ("Invalid keyword argument", kw);
@@ -5781,8 +5769,6 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */)
else
test = get_hash_table_user_test (test_arg);
- bool purecopy = !NILP (purecopy_arg);
-
EMACS_INT size;
if (NILP (size_arg))
size = DEFAULT_HASH_SIZE;
@@ -5805,7 +5791,7 @@ usage: (make-hash-table &rest KEYWORD-ARGS) */)
else
signal_error ("Invalid hash table weakness", weakness_arg);
- return make_hash_table (test, size, weak, purecopy);
+ return make_hash_table (test, size, weak);
}
diff --git a/src/frame.c b/src/frame.c
index 78fa41bbe62..4597dd5cecd 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -1043,7 +1043,7 @@ make_frame (bool mini_p)
rw->pixel_height = rw->total_lines * FRAME_LINE_HEIGHT (f);
fset_face_hash_table
- (f, make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false));
+ (f, make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None));
if (mini_p)
{
diff --git a/src/image.c b/src/image.c
index 0012abcb451..92906f5274c 100644
--- a/src/image.c
+++ b/src/image.c
@@ -6200,7 +6200,7 @@ xpm_make_color_table_h (void (**put_func) (Lisp_Object,
const char *, int,
{
*put_func = xpm_put_color_table_h;
*get_func = xpm_get_color_table_h;
- return make_hash_table (&hashtest_equal, DEFAULT_HASH_SIZE, Weak_None,
false);
+ return make_hash_table (&hashtest_equal, DEFAULT_HASH_SIZE, Weak_None);
}
static void
diff --git a/src/json.c b/src/json.c
index 282dca6e8ff..bfdf7af0ab0 100644
--- a/src/json.c
+++ b/src/json.c
@@ -1564,7 +1564,7 @@ json_parse_object (struct json_parser *parser)
case json_object_hashtable:
{
EMACS_INT value = (parser->object_workspace_current - first) / 2;
- result = make_hash_table (&hashtest_equal, value, Weak_None, false);
+ result = make_hash_table (&hashtest_equal, value, Weak_None);
struct Lisp_Hash_Table *h = XHASH_TABLE (result);
for (size_t i = first; i < parser->object_workspace_current; i += 2)
{
diff --git a/src/lisp.h b/src/lisp.h
index 1370fe7e30f..5ebbe4f9860 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2620,10 +2620,6 @@ struct Lisp_Hash_Table
/* Hash table test (only used when frozen in dump) */
hash_table_std_test_t frozen_test : 2;
- /* True if the table can be purecopied. The table cannot be
- changed afterwards. */
- bool_bf purecopy : 1;
-
/* True if the table is mutable. Ordinarily tables are mutable, but
some tables are not: while a table is being mutated it is immutable
for recursive attempts to mutate it. */
@@ -4258,7 +4254,7 @@ extern char *extract_data_from_object (Lisp_Object,
ptrdiff_t *, ptrdiff_t *);
EMACS_UINT hash_string (char const *, ptrdiff_t);
EMACS_UINT sxhash (Lisp_Object);
Lisp_Object make_hash_table (const struct hash_table_test *, EMACS_INT,
- hash_table_weakness_t, bool);
+ hash_table_weakness_t);
Lisp_Object hash_table_weakness_symbol (hash_table_weakness_t weak);
ptrdiff_t hash_lookup (struct Lisp_Hash_Table *, Lisp_Object);
ptrdiff_t hash_lookup_get_hash (struct Lisp_Hash_Table *h, Lisp_Object key,
diff --git a/src/lread.c b/src/lread.c
index a95abd687ac..8adb862d9a0 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -2490,11 +2490,11 @@ readevalloop (Lisp_Object readcharfun,
if (! HASH_TABLE_P (read_objects_map)
|| XHASH_TABLE (read_objects_map)->count)
read_objects_map
- = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false);
+ = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None);
if (! HASH_TABLE_P (read_objects_completed)
|| XHASH_TABLE (read_objects_completed)->count)
read_objects_completed
- = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false);
+ = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None);
if (!NILP (Vpurify_flag) && c == '(')
val = read0 (readcharfun, false);
else
@@ -2740,11 +2740,11 @@ read_internal_start (Lisp_Object stream, Lisp_Object
start, Lisp_Object end,
if (! HASH_TABLE_P (read_objects_map)
|| XHASH_TABLE (read_objects_map)->count)
read_objects_map
- = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false);
+ = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None);
if (! HASH_TABLE_P (read_objects_completed)
|| XHASH_TABLE (read_objects_completed)->count)
read_objects_completed
- = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None, false);
+ = make_hash_table (&hashtest_eq, DEFAULT_HASH_SIZE, Weak_None);
if (STRINGP (stream)
|| ((CONSP (stream) && STRINGP (XCAR (stream)))))
diff --git a/src/pdumper.c b/src/pdumper.c
index 5a55dccf09f..5bd0d8ca44a 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -2747,7 +2747,6 @@ dump_hash_table (struct dump_context *ctx, Lisp_Object
object)
dump_pseudovector_lisp_fields (ctx, &out->header, &hash->header);
DUMP_FIELD_COPY (out, hash, count);
DUMP_FIELD_COPY (out, hash, weakness);
- DUMP_FIELD_COPY (out, hash, purecopy);
DUMP_FIELD_COPY (out, hash, mutable);
DUMP_FIELD_COPY (out, hash, frozen_test);
if (hash->key_and_value)
diff --git a/src/pgtkterm.c b/src/pgtkterm.c
index 246604ec18b..5b55c1b488d 100644
--- a/src/pgtkterm.c
+++ b/src/pgtkterm.c
@@ -7485,7 +7485,7 @@ If set to a non-float value, there will be no wait at
all. */);
DEFVAR_LISP ("pgtk-keysym-table", Vpgtk_keysym_table,
doc: /* Hash table of character codes indexed by X keysym codes. */);
- Vpgtk_keysym_table = make_hash_table (&hashtest_eql, 900, Weak_None, false);
+ Vpgtk_keysym_table = make_hash_table (&hashtest_eql, 900, Weak_None);
window_being_scrolled = Qnil;
staticpro (&window_being_scrolled);
diff --git a/src/print.c b/src/print.c
index 8f28b14e8b6..35a2dac6263 100644
--- a/src/print.c
+++ b/src/print.c
@@ -2605,9 +2605,6 @@ print_object (Lisp_Object obj, Lisp_Object printcharfun,
bool escapeflag)
printcharfun, escapeflag);
}
- if (h->purecopy)
- print_c_string (" purecopy t", printcharfun);
-
ptrdiff_t size = h->count;
if (size > 0)
{
diff --git a/src/profiler.c b/src/profiler.c
index 6e1dc46abd3..80173ac735e 100644
--- a/src/profiler.c
+++ b/src/profiler.c
@@ -562,7 +562,7 @@ export_log (struct profiler_log *plog)
the log but close enough, and will never confuse two distinct
keys in the log. */
Lisp_Object h = make_hash_table (&hashtest_equal, DEFAULT_HASH_SIZE,
- Weak_None, false);
+ Weak_None);
for (int i = 0; i < log->size; i++)
{
int count = get_log_count (log, i);
diff --git a/src/xfaces.c b/src/xfaces.c
index 7763fdd4953..9c54fe5b051 100644
--- a/src/xfaces.c
+++ b/src/xfaces.c
@@ -7518,7 +7518,7 @@ only for this purpose. */);
doc: /* Hash table of global face definitions (for internal use only.)
*/);
Vface_new_frame_defaults =
/* 33 entries is enough to fit all basic faces */
- make_hash_table (&hashtest_eq, 33, Weak_None, false);
+ make_hash_table (&hashtest_eq, 33, Weak_None);
DEFVAR_LISP ("face-default-stipple", Vface_default_stipple,
doc: /* Default stipple pattern used on monochrome displays.
diff --git a/src/xterm.c b/src/xterm.c
index f78b20e0d58..c723362c91a 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -32739,7 +32739,7 @@ If set to a non-float value, there will be no wait at
all. */);
DEFVAR_LISP ("x-keysym-table", Vx_keysym_table,
doc: /* Hash table of character codes indexed by X keysym codes. */);
- Vx_keysym_table = make_hash_table (&hashtest_eql, 900, Weak_None, false);
+ Vx_keysym_table = make_hash_table (&hashtest_eql, 900, Weak_None);
DEFVAR_BOOL ("x-frame-normalize-before-maximize",
x_frame_normalize_before_maximize,
- scratch/no-purespace 9c4cd4dea4c 07/41: Pure storage removal: Replace calls to removed functions, (continued)
- scratch/no-purespace 9c4cd4dea4c 07/41: Pure storage removal: Replace calls to removed functions, Stefan Kangas, 2024/12/10
- scratch/no-purespace e660ac8ce4d 19/41: Make bindings--define-key obsolete, Stefan Kangas, 2024/12/10
- scratch/no-purespace c6870a14a3f 24/41: Don't call purecopy in common-win.el, Stefan Kangas, 2024/12/10
- scratch/no-purespace e29294f7696 28/41: Don't call purecopy in help-mode.el, Stefan Kangas, 2024/12/10
- scratch/no-purespace 31c052c7ce9 32/41: Don't call purecopy in mouse.el, Stefan Kangas, 2024/12/10
- scratch/no-purespace 4af70b2fafd 15/41: Don't recognize "bootstrap" option for --temacs, Stefan Kangas, 2024/12/10
- scratch/no-purespace 5b792477252 04/41: Unexec removal: Adjust and simplify W32-specific code, Stefan Kangas, 2024/12/10
- scratch/no-purespace 1c10c259483 11/41: Pure storage removal: Adjust nativecomp code, Stefan Kangas, 2024/12/10
- scratch/no-purespace 52c8a7e3dd8 03/41: Unexec removal: Remove HYBRID_MALLOC support, Stefan Kangas, 2024/12/10
- scratch/no-purespace 42664427fbf 14/41: Pure storage removal: Documentation, Stefan Kangas, 2024/12/10
- scratch/no-purespace 63a8d3cb70f 09/41: Pure storage removal: Remove purecopy hash table flag,
Stefan Kangas <=
- scratch/no-purespace 40faf3ededc 18/41: Purecopy removal: Lisp code, Stefan Kangas, 2024/12/10
- scratch/no-purespace 49a674f44ae 21/41: Avoid compiler warning in process_mark_stack, Stefan Kangas, 2024/12/10
- scratch/no-purespace 4154dd74b90 31/41: Don't call purecopy in emacs-lisp/*.el, Stefan Kangas, 2024/12/10
- scratch/no-purespace 9e6f9030e03 25/41: Don't call purecopy in bindings.el, Stefan Kangas, 2024/12/10
- scratch/no-purespace 4e695acf2c8 23/41: Don't call purecopy in international/*.el, Stefan Kangas, 2024/12/10
- scratch/no-purespace 3ccd53e80b5 22/41: Remove purecopy calls from files.el, Stefan Kangas, 2024/12/10
- scratch/no-purespace 67ed43ae5c7 26/41: Don't call purecopy in progmodes/*.el, Stefan Kangas, 2024/12/10
- scratch/no-purespace b608b0de93f 29/41: Don't call purecopy in vc/*.el, Stefan Kangas, 2024/12/10
- scratch/no-purespace e852289e212 36/41: Remove unused function my_heap_start, Stefan Kangas, 2024/12/10
- scratch/no-purespace 6a52471cb50 27/41: Don't call purecopy in textmodes/*.el, Stefan Kangas, 2024/12/10