mirror of
https://github.com/neovim/neovim.git
synced 2025-10-07 02:16:31 +00:00
refactor: free more reachable memory with EXITFREE (#26349)
Discovered using __sanitizer_print_memory_profile().
This commit is contained in:
@@ -879,15 +879,20 @@ void grid_free(ScreenGrid *grid)
|
||||
grid->line_offset = NULL;
|
||||
}
|
||||
|
||||
#ifdef EXITFREE
|
||||
/// Doesn't allow reinit, so must only be called by free_all_mem!
|
||||
void grid_free_all_mem(void)
|
||||
{
|
||||
grid_free(&default_grid);
|
||||
grid_free(&msg_grid);
|
||||
XFREE_CLEAR(msg_grid.dirty_col);
|
||||
xfree(linebuf_char);
|
||||
xfree(linebuf_attr);
|
||||
xfree(linebuf_vcol);
|
||||
xfree(linebuf_scratch);
|
||||
set_destroy(glyph, &glyph_cache);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// (Re)allocates a window grid if size changed while in ext_multigrid mode.
|
||||
/// Updates size, offsets and handle for the grid regardless.
|
||||
|
Reference in New Issue
Block a user