summaryrefslogtreecommitdiff
path: root/src/insdel.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2017-02-20 14:05:41 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2017-02-20 14:05:41 -0500
commit160bcfeed6047b65cf8b9f00c404061b03dfe141 (patch)
tree339ced0e1542dc8b40b4f9e244df91c1d5e52184 /src/insdel.c
parent27a76829fe71efcb048686a3c42221aec1020f10 (diff)
downloademacs-160bcfeed6047b65cf8b9f00c404061b03dfe141.tar.gz
* src/insdel.c (make_gap): Improve comment.
Diffstat (limited to 'src/insdel.c')
-rw-r--r--src/insdel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/insdel.c b/src/insdel.c
index 76af3ff9a4c..5a95d41e7ab 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -572,7 +572,9 @@ make_gap (ptrdiff_t nbytes_added)
* With /4096 => 131s
* With /∞ => gave up after 858s
* Of couse, ideally we should never call set-buffer-multibyte on
- * a non-empty buffer (e.g. use buffer-swa-text instead). */
+ * a non-empty buffer (e.g. use buffer-swap-text instead).
+ * We chose /64 because it already brings almost the best performance while
+ * limiting the potential wasted memory to 1.5%. */
make_gap_larger (max (nbytes_added, (Z - BEG) / 64));
#if defined USE_MMAP_FOR_BUFFERS || defined REL_ALLOC || defined DOUG_LEA_MALLOC
else