mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
adjust_glyph_matrix reallocation improvement
* src/dispnew.c (adjust_glyph_matrix): Use xfree + xcalloc instead of xnrealloc + memset, as there is no need to preserve the old contents.
This commit is contained in:
parent
64eb869b68
commit
19264b6912
1 changed files with 5 additions and 6 deletions
|
|
@ -500,16 +500,15 @@ adjust_glyph_matrix (struct window *w, struct glyph_matrix *matrix, int x, int y
|
|||
|
||||
while (row < end)
|
||||
{
|
||||
/* Only realloc if matrix got wider or taller (bug#77961). */
|
||||
/* Realloc if matrix got wider or taller (bug#77961). */
|
||||
if (dim.width > matrix->matrix_w || new_rows)
|
||||
{
|
||||
row->glyphs[LEFT_MARGIN_AREA]
|
||||
= xnrealloc (row->glyphs[LEFT_MARGIN_AREA],
|
||||
dim.width, sizeof (struct glyph));
|
||||
xfree (row->glyphs[LEFT_MARGIN_AREA]);
|
||||
row->glyphs[LEFT_MARGIN_AREA] = NULL;
|
||||
/* We actually need to clear only the 'frame' member, but
|
||||
it's easier to clear everything. */
|
||||
memset (row->glyphs[LEFT_MARGIN_AREA], 0,
|
||||
dim.width * sizeof (struct glyph));
|
||||
row->glyphs[LEFT_MARGIN_AREA]
|
||||
= xcalloc (dim.width, sizeof (struct glyph));
|
||||
}
|
||||
|
||||
if ((row == matrix->rows + dim.height - 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue