* 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'
(cherry picked from commit
d6b05b128280cc23dc77a1a06194c4e69d1ac519)
@example
(keymap-global-set "<tool-bar>"
- `(menu-item ,(purecopy "tool bar") ignore
+ '(menu-item "tool bar" ignore
:filter tool-bar-make-keymap))
@end example
psf
psychotherapy
pty
-purecopy
qu
quux
rassq
(side-effect-and-error-free-fns
'(
;; alloc.c
- bool-vector cons list make-marker purecopy record vector
+ bool-vector cons list make-marker record vector
;; buffer.c
buffer-list buffer-live-p current-buffer overlay-lists overlayp
;; casetab.c
;; than usual.
(setq max-lisp-eval-depth (max max-lisp-eval-depth 3400))))
-(if (eq t purify-flag)
- ;; Hash consing saved around 11% of pure space in my tests.
- (setq purify-flag (make-hash-table :test #'equal :size 80000)))
-
(message "Using load-path %s" load-path)
(if dump-mode
;; file-local variables.
(defvar comp--no-native-compile (make-hash-table :test #'equal)))
-(when (hash-table-p purify-flag)
- (let ((strings 0)
- (vectors 0)
- (bytecodes 0)
- (conses 0)
- (others 0))
- (maphash (lambda (k v)
- (cond
- ((stringp k) (setq strings (1+ strings)))
- ((vectorp k) (setq vectors (1+ vectors)))
- ((consp k) (setq conses (1+ conses)))
- ((byte-code-function-p v) (setq bytecodes (1+ bytecodes)))
- (t (setq others (1+ others)))))
- purify-flag)
- (message "Pure-hashed: %d strings, %d vectors, %d conses, %d bytecodes, %d others"
- strings vectors conses bytecodes others)))
-
-;; Avoid error if user loads some more libraries now and make sure the
-;; hash-consing hash table is GC'd.
+
+;; Avoid error if user loads some more libraries now.
(setq purify-flag nil)
(if (null (garbage-collect))
(define-obsolete-function-alias 'fetch-bytecode #'ignore "30.1")
+(define-obsolete-function-alias 'purecopy #'identity "31.1")
+
\f
;;;; Alternate names for functions - these are not being phased out.
xfree (p);
}
-
-static Lisp_Object purecopy (Lisp_Object obj);
-
-DEFUN ("purecopy", Fpurecopy, Spurecopy, 1, 1, 0,
- doc: /* Make a copy of object OBJ in pure storage.
-Recursively copies contents of vectors and cons cells.
-Does not copy symbols. Copies strings without text properties. */)
- (register Lisp_Object obj)
-{
- if (NILP (Vpurify_flag))
- return obj;
- else if (MARKERP (obj) || OVERLAYP (obj) || SYMBOLP (obj))
- /* Can't purify those. */
- return obj;
- else
- return purecopy (obj);
-}
-
-static Lisp_Object
-purecopy (Lisp_Object obj)
-{
- if (FIXNUMP (obj) || SUBRP (obj))
- return obj; /* No need to hash. */
-
- if (HASH_TABLE_P (Vpurify_flag)) /* Hash consing. */
- {
- Lisp_Object tmp = Fgethash (obj, Vpurify_flag, Qnil);
- if (!NILP (tmp))
- return tmp;
- Fputhash (obj, obj, Vpurify_flag);
- }
-
- return obj;
-}
-
-
\f
/***********************************************************************
Protection from GC
defsubr (&Smake_symbol);
defsubr (&Smake_marker);
defsubr (&Smake_finalizer);
- defsubr (&Spurecopy);
defsubr (&Sgarbage_collect);
defsubr (&Sgarbage_collect_maybe);
defsubr (&Smemory_info);