summaryrefslogtreecommitdiff
path: root/src/buffer.h
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2013-01-09 17:50:22 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2013-01-09 17:50:22 +0400
commiteefd727851555237c7bc205b7ad255c50ba3fff9 (patch)
tree5009d8d2c8773c64504252c8e8738f14b84d2547 /src/buffer.h
parentccd04887a3f15ce0e52af801d8a70c91d695f78c (diff)
downloademacs-eefd727851555237c7bc205b7ad255c50ba3fff9.tar.gz
* lisp.h (make_gap_1): New prototype.
* buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special gap size values. * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common naming convention. (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code. * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment. (make_gap_1): New function to adjust the gap of any buffer. * coding.c (coding_alloc_by_making_gap): Use it. * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE, GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
Diffstat (limited to 'src/buffer.h')
-rw-r--r--src/buffer.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h
index eb6a9d4d3e1..ec9c34b3eb3 100644
--- a/src/buffer.h
+++ b/src/buffer.h
@@ -320,6 +320,16 @@ while (0)
#define BUF_BYTES_MAX \
(ptrdiff_t) min (MOST_POSITIVE_FIXNUM - 1, min (SIZE_MAX, PTRDIFF_MAX))
+/* Maximum gap size after compact_buffer, in bytes. Also
+ used in make_gap_larger to get some extra reserved space. */
+
+#define GAP_BYTES_DFL 2000
+
+/* Minimum gap size after compact_buffer, in bytes. Also
+ used in make_gap_smaller to avoid too small gap size. */
+
+#define GAP_BYTES_MIN 20
+
/* Return the address of byte position N in current buffer. */
#define BYTE_POS_ADDR(n) \