render: performance: don't stack allocate glyph sequence

This commit is contained in:
Daniel Eklöf 2019-07-06 18:31:14 +02:00
parent 00c5b27bfa
commit 050f7ea6ea
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -30,6 +30,8 @@ struct glyph_sequence {
struct rgba foreground;
};
static struct glyph_sequence gseq;
static void
grid_render_update(struct terminal *term, struct buffer *buf, const struct damage *dmg)
{
@ -52,7 +54,8 @@ grid_render_update(struct terminal *term, struct buffer *buf, const struct damag
const int cols = term->cols;
struct glyph_sequence gseq = {.g = gseq.glyphs};
gseq.g = gseq.glyphs;
gseq.count = 0;
for (int linear_cursor = start,
row = ((start - term->grid->offset) % term->grid->size) / cols,