summaryrefslogtreecommitdiff
path: root/src/coding.h
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2013-10-08 10:40:09 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2013-10-08 10:40:09 +0400
commitf8498081911e4c1381c4bed5ac3b664ceca57d64 (patch)
treed96b7bf86daef23ecae0f9239ef79bff81500490 /src/coding.h
parentb7d5bd823c239a8ee3613abcc4e24fe290a673d0 (diff)
Do not allocate huge temporary memory areas and objects while encoding
for file I/O, thus reducing an enormous memory usage for large buffers. See http://lists.gnu.org/archive/html/emacs-devel/2013-10/msg00180.html. * coding.h (struct coding_system): New member raw_destination. * coding.c (setup_coding_system): Initialize it to zero. (encode_coding_object): If raw_destination is set, do not create dst_object. Add comment. * fileio.c (toplevel): New constant E_WRITE_MAX. (e_write): Do not encode more than E_WRITE_MAX characters per one loop iteration. Use raw_destination if E_WRITE_MAX characters is encoded.
Diffstat (limited to 'src/coding.h')
-rw-r--r--src/coding.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/coding.h b/src/coding.h
index 2c01a05d19..0472bec99d 100644
--- a/src/coding.h
+++ b/src/coding.h
@@ -512,6 +512,10 @@ struct coding_system
`charbuf', but at `src_object'. */
unsigned chars_at_source : 1;
+ /* Nonzero if the result of conversion is in `destination'
+ buffer rather than in `dst_object'. */
+ unsigned raw_destination : 1;
+
/* Set to 1 if charbuf contains an annotation. */
unsigned annotated : 1;