[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/gcmh f542908 19/32: Merge branch 'feature/prevent-dupli
From: |
Andrea Corallo |
Subject: |
[elpa] externals/gcmh f542908 19/32: Merge branch 'feature/prevent-duplicate-timers' into 'master' |
Date: |
Mon, 16 Nov 2020 17:32:06 -0500 (EST) |
branch: externals/gcmh
commit f542908b9ae4405d70fa70f42bd62618c5de4b95
Merge: 1953d91 537d050
Author: Koral <andrea_corallo@yahoo.it>
Commit: Koral <andrea_corallo@yahoo.it>
Merge branch 'feature/prevent-duplicate-timers' into 'master'
Feature/prevent duplicate timers
See merge request koral/gcmh!2
---
gcmh.el | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
diff --git a/gcmh.el b/gcmh.el
index d2eae63..bbccbc9 100644
--- a/gcmh.el
+++ b/gcmh.el
@@ -35,16 +35,16 @@
;;; Code:
(defcustom gcmh-low-cons-threshold 800000
- "Low cons gc threshold.
-This is the gc threshold used while while idling. Default value
-is the same of `gc-cons-threshold' default"
+ "Low cons GC threshold.
+This is the GC threshold used while idling. Default value is the
+same of `gc-cons-threshold' default."
:group 'gcmh
:type 'number)
(defcustom gcmh-high-cons-threshold #x40000000
- "High cons gc threshold.
+ "High cons GC threshold.
This should be set to a value that makes GC unlikely but does not
-make the OS paging."
+cause OS paging."
:group 'gcmh
:type 'number)
@@ -59,7 +59,7 @@ make the OS paging."
:type 'boolean)
(defvar gcmh-idle-timer nil
- "Idle timer for trigering GC.")
+ "Idle timer for triggering GC.")
(defmacro gcmh-time (&rest body)
"Measure and return the time it takes to evaluate BODY."
@@ -68,7 +68,7 @@ make the OS paging."
(float-time (time-since time))))
(defun gcmh-set-high-threshold ()
- "Set the high gc thereshold.
+ "Set the high GC threshold.
This is to be used with the `pre-command-hook'."
(setq gc-cons-threshold gcmh-high-cons-threshold))
@@ -86,6 +86,10 @@ This is to be used with the `pre-command-hook'."
"Minor mode to tweak Garbage Collection strategy."
:lighter " GCMH"
:global t
+
+ ;; Cancel any pending timer (prevents duplicate idle timers).
+ (when (timerp gcmh-idle-timer)
+ (cancel-timer gcmh-idle-timer))
(if gcmh-mode
(progn
(setq gc-cons-threshold gcmh-high-cons-threshold
@@ -94,7 +98,6 @@ This is to be used with the `pre-command-hook'."
#'gcmh-idle-garbage-collect))
;; Release severe GC strategy before the user restart to working
(add-hook 'pre-command-hook #'gcmh-set-high-threshold))
- (cancel-timer gcmh-idle-timer)
(setq gc-cons-threshold gcmh-low-cons-threshold
gcmh-idle-timer nil)
(remove-hook 'pre-command-hook #'gcmh-set-high-threshold)))
- [elpa] externals/gcmh 1953d91 15/32: Merge branch 'master' into 'master', (continued)
- [elpa] externals/gcmh 1953d91 15/32: Merge branch 'master' into 'master', Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh 5bf0ed3 16/32: Prevent duplicate idle timers being created, Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh a7f8cc2 17/32: Correct minor typos, Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh 91cd1f7 07/32: autoload minor mode, Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh e7af13d 11/32: better readme layout, Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh c96bd70 12/32: update readme, Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh 5664cb3 14/32: Add garbage collection start message, Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh 75de01e 04/32: add missing requires, Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh c1bc27a 06/32: Add readme, Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh 65787bc 08/32: typo fix, Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh f542908 19/32: Merge branch 'feature/prevent-duplicate-timers' into 'master',
Andrea Corallo <=
- [elpa] externals/gcmh f3389e9 26/32: Always use `setf' in place of `setq', Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh 345121d 29/32: Readme update, Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh 81844fa 09/32: update readme, Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh dd69c84 10/32: add warning into readme, Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh 537d050 18/32: Further minor typo, Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh 8867533 20/32: Improve messaging, Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh f449abb 27/32: No reason anymore to use `run-with-idle-timer' so use `run-with-timer', Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh 8bf0666 30/32: Rename `gcmh-register-idle-timer' into `gcmh-register-idle-gc', Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh 12fd03c 24/32: Set the new timer for running once and on post-command-hook, Andrea Corallo, 2020/11/16
- [elpa] externals/gcmh 72683e1 13/32: Update conventions, Andrea Corallo, 2020/11/16