Variable: treesit-max-buffer-size
treesit-max-buffer-size is a customizable variable defined in
treesit.el.gz.
Value
41943040
Documentation
Maximum buffer size (in bytes) for enabling tree-sitter parsing.
A typical tree-sitter parser needs 10 times as much memory as the buffer it parses. Also, the tree-sitter library has a hard limit of max unsigned 32-bit value for byte offsets into buffer text.
This variable was added, or its default value changed, in Emacs 29.1.
Source Code
;; Defined in /usr/src/emacs/lisp/treesit.el.gz
(defcustom treesit-max-buffer-size
(let ((mb (* 1024 1024)))
;; 40MB for 64-bit systems, 15 for 32-bit.
(if (or (< most-positive-fixnum (* 2.0 1024 mb))
;; 32-bit system with wide ints.
(string-search "--with-wide-int" system-configuration-options))
(* 15 mb)
(* 40 mb)))
"Maximum buffer size (in bytes) for enabling tree-sitter parsing.
A typical tree-sitter parser needs 10 times as much memory as the
buffer it parses. Also, the tree-sitter library has a hard limit
of max unsigned 32-bit value for byte offsets into buffer text."
:type 'integer
:version "29.1")