aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorStefan Kangas2024-12-10 19:39:03 +0100
committerStefan Kangas2024-12-12 22:48:21 +0100
commitd6b05b128280cc23dc77a1a06194c4e69d1ac519 (patch)
treee991f9a34b38d5e02e65bdacff2b7e74566f5e42 /src/alloc.c
parentb299a5d184542cdc66632b1a47947151a11c035e (diff)
downloademacs-d6b05b128280cc23dc77a1a06194c4e69d1ac519.tar.gz
emacs-d6b05b128280cc23dc77a1a06194c4e69d1ac519.zip
Make 'purecopy' an obsolete function alias for 'identity'
* lisp/subr.el (purecopy): New obsolete function alias for 'identity'. * src/alloc.c (purecopy): Remove function. (Fpurecopy): Remove DEFUN. (syms_of_alloc): Remove defsubr for above DEFUN. * lisp/loadup.el (purify-flag): Don't set to hash table. * doc/lispref/spellfile: * doc/lispref/keymaps.texi (Tool Bar): * lisp/emacs-lisp/byte-opt.el (side-effect-free-fns): Delete references to 'purecopy'
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 5e2747af1f0..82d1a3a9891 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5585,42 +5585,6 @@ hash_table_free_bytes (void *p, ptrdiff_t nbytes)
5585 xfree (p); 5585 xfree (p);
5586} 5586}
5587 5587
5588
5589static Lisp_Object purecopy (Lisp_Object obj);
5590
5591DEFUN ("purecopy", Fpurecopy, Spurecopy, 1, 1, 0,
5592 doc: /* Make a copy of object OBJ in pure storage.
5593Recursively copies contents of vectors and cons cells.
5594Does not copy symbols. Copies strings without text properties. */)
5595 (register Lisp_Object obj)
5596{
5597 if (NILP (Vpurify_flag))
5598 return obj;
5599 else if (MARKERP (obj) || OVERLAYP (obj) || SYMBOLP (obj))
5600 /* Can't purify those. */
5601 return obj;
5602 else
5603 return purecopy (obj);
5604}
5605
5606static Lisp_Object
5607purecopy (Lisp_Object obj)
5608{
5609 if (FIXNUMP (obj) || SUBRP (obj))
5610 return obj; /* No need to hash. */
5611
5612 if (HASH_TABLE_P (Vpurify_flag)) /* Hash consing. */
5613 {
5614 Lisp_Object tmp = Fgethash (obj, Vpurify_flag, Qnil);
5615 if (!NILP (tmp))
5616 return tmp;
5617 Fputhash (obj, obj, Vpurify_flag);
5618 }
5619
5620 return obj;
5621}
5622
5623
5624 5588
5625/*********************************************************************** 5589/***********************************************************************
5626 Protection from GC 5590 Protection from GC
@@ -7748,7 +7712,6 @@ N should be nonnegative. */);
7748 defsubr (&Smake_symbol); 7712 defsubr (&Smake_symbol);
7749 defsubr (&Smake_marker); 7713 defsubr (&Smake_marker);
7750 defsubr (&Smake_finalizer); 7714 defsubr (&Smake_finalizer);
7751 defsubr (&Spurecopy);
7752 defsubr (&Sgarbage_collect); 7715 defsubr (&Sgarbage_collect);
7753 defsubr (&Sgarbage_collect_maybe); 7716 defsubr (&Sgarbage_collect_maybe);
7754 defsubr (&Smemory_info); 7717 defsubr (&Smemory_info);