diff options
| author | Gerd Moellmann | 2000-09-11 18:26:43 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-09-11 18:26:43 +0000 |
| commit | cc0f95a474767a554832d03a23c3a9a7cba833e6 (patch) | |
| tree | b947a5d25577ed57000e1a4e49a2c127de68a06d | |
| parent | e7997ff475b93087e6f6fca4630f4fdf9b47df8f (diff) | |
| download | emacs-cc0f95a474767a554832d03a23c3a9a7cba833e6.tar.gz emacs-cc0f95a474767a554832d03a23c3a9a7cba833e6.zip | |
(byte-compile-defvar): Only cons onto
current-load-list in top-level forms. Else this leaks a cons cell
every time a defun is called.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 25 |
2 files changed, 17 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 01244908d57..464f4de84db 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2000-09-11 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * bytecomp.el (byte-compile-defvar): Only cons onto | ||
| 4 | current-load-list in top-level forms. Else this leaks a cons cell | ||
| 5 | every time a defun is called. | ||
| 6 | |||
| 1 | 2000-09-11 Miles Bader <miles@lsi.nec.co.jp> | 7 | 2000-09-11 Miles Bader <miles@lsi.nec.co.jp> |
| 2 | 8 | ||
| 3 | * diff-mode.el (diff-apply-hunk): Function basically rewritten. | 9 | * diff-mode.el (diff-apply-hunk): Function basically rewritten. |
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index bdcb17cfa76..c58038ba2bb 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -10,7 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | ;;; This version incorporates changes up to version 2.10 of the | 11 | ;;; This version incorporates changes up to version 2.10 of the |
| 12 | ;;; Zawinski-Furuseth compiler. | 12 | ;;; Zawinski-Furuseth compiler. |
| 13 | (defconst byte-compile-version "$Revision: 2.73 $") | 13 | (defconst byte-compile-version "$Revision: 1.1 $") |
| 14 | 14 | ||
| 15 | ;; This file is part of GNU Emacs. | 15 | ;; This file is part of GNU Emacs. |
| 16 | 16 | ||
| @@ -3220,19 +3220,16 @@ If FORM is a lambda or a macro, byte-compile it as a function." | |||
| 3220 | (setq byte-compile-bound-variables | 3220 | (setq byte-compile-bound-variables |
| 3221 | (cons var byte-compile-bound-variables))) | 3221 | (cons var byte-compile-bound-variables))) |
| 3222 | (byte-compile-body-do-effect | 3222 | (byte-compile-body-do-effect |
| 3223 | (list (if (cdr (cdr form)) | 3223 | (list |
| 3224 | (if (eq (car form) 'defconst) | 3224 | ;; Just as a real defvar would, but only in top-level forms. |
| 3225 | (list 'setq var value) | 3225 | (when (null byte-compile-current-form) |
| 3226 | (list 'or (list 'boundp (list 'quote var)) | 3226 | `(push ',var current-load-list)) |
| 3227 | (list 'setq var value)))) | 3227 | (when (and string (null byte-compile-current-form)) |
| 3228 | ;; Put the defined variable in this library's load-history entry | 3228 | `(put ',var 'variable-documentation ,string)) |
| 3229 | ;; just as a real defvar would. | 3229 | (if (cdr (cdr form)) |
| 3230 | (list 'setq 'current-load-list | 3230 | (if (eq (car form) 'defconst) |
| 3231 | (list 'cons (list 'quote var) | 3231 | `(setq ,var ,value) |
| 3232 | 'current-load-list)) | 3232 | `(if (boundp ',var) ',var (setq ,var ,value)))))))) |
| 3233 | (if string | ||
| 3234 | (list 'put (list 'quote var) ''variable-documentation string)) | ||
| 3235 | (list 'quote var))))) | ||
| 3236 | 3233 | ||
| 3237 | (defun byte-compile-autoload (form) | 3234 | (defun byte-compile-autoload (form) |
| 3238 | (and (byte-compile-constp (nth 1 form)) | 3235 | (and (byte-compile-constp (nth 1 form)) |