]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Speed up clipboard copies.
authorJeff Westfahl <jeff.westfahl@ni.com>
Mon, 27 Jun 2016 14:58:16 +0000 (09:58 -0500)
committerJeff Westfahl <jeff.westfahl@ni.com>
Mon, 27 Jun 2016 14:58:16 +0000 (09:58 -0500)
Copying large scrollback buffers to the clipboard can take a long time,
up to several minutes. Doubling the size of the clipboard copy buffer
when more space is needed, instead of just adding a small constant size,
significantly speeds up clipboard copies of large scrollback buffers.

terminal.c

index 7a444b7192647b1841fec3fe6aa6f0a79128d70a..5b37fe796bc4755a759be3e0cb8c8b63a3784bb1 100644 (file)
@@ -5445,7 +5445,7 @@ typedef struct {
 static void clip_addchar(clip_workbuf *b, wchar_t chr, int attr)
 {
     if (b->bufpos >= b->buflen) {
-       b->buflen += 128;
+       b->buflen *= 2;
        b->textbuf = sresize(b->textbuf, b->buflen, wchar_t);
        b->textptr = b->textbuf + b->bufpos;
        b->attrbuf = sresize(b->attrbuf, b->buflen, int);