/// Try to free memory. Used when trying to recover from out of memory errors. /// @see {xmalloc} void try_to_free_memory(void) { static bool trying_to_free = false; // avoid recursive calls if (trying_to_free) return; trying_to_free = true; // free any scrollback text clear_sb_text(true); // Try to save all buffers and release as many blocks as possible mf_release_all(); trying_to_free = false; }
/// Try to free memory. Used when trying to recover from out of memory errors. /// @see {xmalloc} static void try_to_free_memory() { static bool trying_to_free = false; // avoid recursive calls if (trying_to_free) return; trying_to_free = true; // free any scrollback text clear_sb_text(); // Try to save all buffers and release as many blocks as possible mf_release_all(); // cleanup recursive lists/dicts garbage_collect(); trying_to_free = false; }