Configure garbage collection

This commit is contained in:
Case Duckworth 2021-03-11 12:16:50 -06:00
parent 5247b85a84
commit 63555d7365
1 changed files with 15 additions and 0 deletions

15
init.el
View File

@ -371,6 +371,21 @@
(acdw/set '((disabled-command-function nil)
(load-prefer-newer t)
(comp-async-report-warnings-errors nil)))
(fset 'yes-or-no-p #'y-or-n-p)
;; Garbage collection
(defun hook--gc-cons-maximize ()
(setq gc-cons-threshold most-positive-fixnum))
(add-hook 'minibuffer-setup-hook #'hook--gc-cons-maximize)
(defun hook--gc-cons-baseline ()
(setq gc-cons-threshold gc-cons-threshold-basis))
(add-hook 'minibuffer-exit-hook #'hook--gc-cons-baseline)
(defun hook--gc-when-unfocused ()
(acdw/when-unfocused #'garbage-collect))
(add-function :after after-focus-change-function
#'hook--gc-when-unfocused)
;;; init.el ends here