mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
fix: reset gc-cons-threshold if not already
This commit is contained in:
@ -899,6 +899,13 @@ Triggers `doom-after-init-hook' and sets `doom-init-time.'"
|
|||||||
(when (doom-context-pop 'startup)
|
(when (doom-context-pop 'startup)
|
||||||
(setq doom-init-time (float-time (time-subtract (current-time) before-init-time)))
|
(setq doom-init-time (float-time (time-subtract (current-time) before-init-time)))
|
||||||
(doom-run-hooks 'doom-after-init-hook)
|
(doom-run-hooks 'doom-after-init-hook)
|
||||||
|
|
||||||
|
;; If `gc-cons-threshold' hasn't been reset at this point, we reset it by
|
||||||
|
;; force (without overwriting `gcmh' or the user's config). If this isn't
|
||||||
|
;; done, this session will be prone to freezing and crashes. This also
|
||||||
|
;; handles the case where the user has `gcmh' disabled.
|
||||||
|
(when (eq (default-value 'gc-cons-threshold) most-positive-fixnum)
|
||||||
|
(setq-default gc-cons-threshold (* 16 1024 1024)))
|
||||||
t))
|
t))
|
||||||
|
|
||||||
(provide 'doom)
|
(provide 'doom)
|
||||||
|
Reference in New Issue
Block a user