emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Emacs-diffs] emacs-26 e5471b2: Add commentary for subtle aspect of


From: Stefan Monnier
Subject: Re: [Emacs-diffs] emacs-26 e5471b2: Add commentary for subtle aspect of frame.el
Date: Fri, 01 Jun 2018 16:30:55 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> --- a/lisp/frame.el
> +++ b/lisp/frame.el
> @@ -2475,6 +2475,9 @@ See also `toggle-frame-maximized'."
>  ;; F5 then produces the correct effect, the variable doesn't need
>  ;; to be in this list; otherwise, it does.
>  (mapc (lambda (var)
> +        ;; Using symbol-function here tells the watcher machinery to
> +        ;; call the C function set-buffer-redisplay directly, thus
> +        ;; avoiding a potential GC.
>          (add-variable-watcher var (symbol-function 'set-buffer-redisplay)))
>        '(line-spacing
>          overline-margin

I don't understand why triggering a GC when setting or let-binding those
vars is something we worry about.

Clearly, it's not a matter of correctness/safety: anyone can add GC-ing
watchers to those vars and hence cause potential GCs at those points.
But in terms of performance I don't see any significant difference
either (if the GC doesn't happen there, it will happen right after that
anyway).

I don't actually have an objection to using (symbol-function
'set-buffer-redisplay), but I can't see any particular reason to do so,
and the above comment doesn't clarify it either for me.

What am I missing?


        Stefan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]