Subject: bug#12196: 24.1.50; setting cache-long-line-scans to non-nil freezes Emacs

From: Eli Zaretskii <[email-masked]>
Date: Wed, 15 Aug 2012 19:36:05 +0300

> Date: Tue, 14 Aug 2012 06:54:28 +0200
> From: Michael Heerdegen <[email-masked]>
> 
> I recently found this variable in the manual: `cache-long-line-scans'.
> 
> However, nearly every time I set it to a non-nil value, Emacs instantly
> freezes, C-g has no more effect.

For me, it didn't freeze, it simply announced that memory was
exhausted and I should exit and restart Emacs.  Under a debugger I saw
that the region cache code tried to allocate some ridiculously large
chunk of memory, like 1.6 GB.  This happened because some changes
about a year ago modified the memory allocation for the cache in a way
that made the cache data structure and the memory it allocated
inconsistent.  So the cache became confused and tried to allocate
more and more memory.

Should be fixed now (revision 109631 on the trunk), please test.