]> git.eshelyaron.com Git - emacs.git/commitdiff
Prevent GC threshold from exceeding fixnum limit during precision scrolling
authorPo Lu <luangruo@yahoo.com>
Wed, 3 Aug 2022 03:42:22 +0000 (11:42 +0800)
committerPo Lu <luangruo@yahoo.com>
Wed, 3 Aug 2022 03:42:22 +0000 (11:42 +0800)
* lisp/pixel-scroll.el (pixel-scroll-start-momentum): Prevent GC
threshold from exceeding most-positive-fixnum.

lisp/pixel-scroll.el

index aefe3c12dc22d074db04ec8e5dd0594da116d6ba..6dba733b9c4dce8a33f5d49bea86eedf73396989 100644 (file)
@@ -761,7 +761,8 @@ It is a vector of the form [ VELOCITY TIME SIGN ]."
     (let ((window (mwheel-event-window event))
           ;; The animations are smoother if the GC threshold is
           ;; reduced for the duration of the animation.
-          (gc-cons-threshold (* gc-cons-threshold 3))
+          (gc-cons-threshold (min most-positive-fixnum
+                                  (* gc-cons-threshold 3)))
           (state nil))
       (when (framep window)
         (setq window (frame-selected-window window)))