emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/emacs-gc-stats 248ade4f62 04/24: Add `emacs-gc-stats-cl


From: ELPA Syncer
Subject: [elpa] externals/emacs-gc-stats 248ade4f62 04/24: Add `emacs-gc-stats-clear' command
Date: Sat, 10 Jun 2023 12:58:44 -0400 (EDT)

branch: externals/emacs-gc-stats
commit 248ade4f62050486a9c216668ba57b80032c50f5
Author: Ihor Radchenko <yantar92@posteo.net>
Commit: Ihor Radchenko <yantar92@posteo.net>

    Add `emacs-gc-stats-clear' command
---
 emacs-gc-stats.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/emacs-gc-stats.el b/emacs-gc-stats.el
index 5b0cf4c27c..36ec740785 100644
--- a/emacs-gc-stats.el
+++ b/emacs-gc-stats.el
@@ -134,6 +134,15 @@ Otherwise, collect symbol."
             (cdr emacs-gc-stats--data))
       (prin1 previous-sessions (current-buffer)))))
 
+(defun emacs-gc-stats-clear ()
+  "Clear GC stats collected so far."
+  (interactive)
+  (setq emacs-gc-stats--data nil)
+  ;; Restart.
+  (when emacs-gc-stats-mode
+    (emacs-gc-stats-mode -1)
+    (emacs-gc-stats-mode +1)))
+
 (define-minor-mode emacs-gc-stats-mode
   "Toggle collecting Emacs GC statistics."
   :global t



reply via email to

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