Do other things with the garbage collector, do they work?

This commit is contained in:
mir 2024-01-24 09:53:58 -09:00
parent 5e795aef6d
commit 1d393de506
2 changed files with 14 additions and 9 deletions

View File

@ -5,7 +5,19 @@
;;; Code: ;;; Code:
(setq gc-cons-threshold (* 8 5000 5000)) ;; blame @chke@emacs.ch if this no worky
(defvar mir/default-gc-thresh gc-cons-threshold)
(defun max-gc-thresh ()
(setq gc-cons-threshold most-positive-fixnum))
(max-gc-thresh)
(defun restore-gc-thresh ()
(setq gc-cons-threshold mir/default-gc-thresh))
(add-hook 'minibuffer-setup-hook #'max-gc-thresh)
(add-hook 'minibuffer-exit-hook #'restore-gc-thresh)
(add-hook 'elpaca-after-init-hook #'restore-gc-thresh)
(setq gc-cons-percentage 0.5)
(run-with-idle-timer 5 t #'garbage-collect)
(setq garbage-collection-messages t)
(defun display-startup-echo-area-message () (defun display-startup-echo-area-message ()
"A re-definition of the function. "A re-definition of the function.
@ -22,9 +34,6 @@ instead of the banal
")) "))
;; Crash the computer by overloading memory
(setq gc-cons-threshold (* 50 1000 1000))
;; Disable package.el so we can use straight ;; Disable package.el so we can use straight
(setq package-enable-at-startup nil) (setq package-enable-at-startup nil)
(defvar use-package-verbose nil) (defvar use-package-verbose nil)

View File

@ -306,7 +306,7 @@ If the current window occupies the whole frame, split it."
(elpaca compat) (elpaca compat)
(elpaca marginalia (marginalia-mode)) (elpaca marginalia (marginalia-mode))
(elpaca gcmh (gcmh-mode)) ;; (elpaca gcmh (gcmh-mode))
(elpaca page-break-lines (elpaca page-break-lines
(add-hook 'emacs-lisp-mode-hook #'page-break-lines-mode)) (add-hook 'emacs-lisp-mode-hook #'page-break-lines-mode))
(elpaca rainbow-mode (elpaca rainbow-mode
@ -331,8 +331,4 @@ If the current window occupies the whole frame, split it."
;; Don't barf out emacs errors as they are encountered ;; Don't barf out emacs errors as they are encountered
(setq debug-on-error nil) (setq debug-on-error nil)
;; lower gc threshold again
(setq gc-cons-threshold (* 2 100 1000))
;; (add-function :before #'after-focus-change-function #'garbage-collect)
;;; init.el ends here ;;; init.el ends here