Browse Source

org-element-cache-map: Do not disable GC

* lisp/org-element.el: Do not disable GC.  This can make Emacs hang in
some particularly bad scenarios.  It is better to lose on performance
a bit compared to Emacs GC hanging.

The edge case is described in https://github.com/emacs-citar/citar/issues/397#issuecomment-1236226809
Ihor Radchenko 1 year ago
parent
commit
1f1d8f909a
1 changed files with 1 additions and 4 deletions
  1. 1 4
      lisp/org-element.el

+ 1 - 4
lisp/org-element.el

@@ -7337,10 +7337,7 @@ the cache."
     (let ((mk (make-marker)))
       (set-marker mk to-pos)
       (setq to-pos mk)))
-  ;; Make sure that garbage collector does not stand on the way to
-  ;; maximum performance.
-  (let ((gc-cons-threshold #x40000000)
-        ;; Bind variables used inside loop to avoid memory
+  (let (;; Bind variables used inside loop to avoid memory
         ;; re-allocation on every iteration.
         ;; See https://emacsconf.org/2021/talks/faster/
         tmpnext-start tmpparent tmpelement)