bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19393: 25.0.50; Emacs cannot determine coding system of ISO-8859 enc


From: Eli Zaretskii
Subject: bug#19393: 25.0.50; Emacs cannot determine coding system of ISO-8859 encoded files
Date: Sat, 20 Dec 2014 09:27:39 +0200

> From: Wolfgang Jenkner <wjenkner@inode.at>
> Cc: 19393@debbugs.gnu.org
> Date: Sat, 20 Dec 2014 04:21:54 +0100
> 
> I have been looking into this with dtrace and what is sure is that
> a large amount of data (increasing up to the order of magnitude of the
> buffer size) is memcpy'd again and again as a result of mmap_realloc
> being called by enlarge_buffer_text.  Apparently, the latter is called
> for buffer gap handling which is triggered by decode_coding_c_string (or
> rather decode_coding_object) in insert-file-contents.  So it seems that
> the effect on memory of this innocent-looking loop there is enormously
> magnified.

Yes, that'd be my guess for the reason.

> But I have to look at the source more closely (not that I expect to get
> any idea how to fix this, though).

Since we know the size of the file, we could perhaps compute the new
buffer size up front (taking some conservative approximations, if
needed), and mmap_realloc it only once.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]