1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00

clip_addchar: merge memory-management performance fix.

This commit is contained in:
Simon Tatham 2016-06-27 19:24:56 +01:00
commit f56dd17709

View File

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