Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ddc_vim/deps.ts>fn.garbagecollect

Dark deno-powered completion framework for neovim/Vim
Go to Latest
function fn.garbagecollect
import { fn } from "https://deno.land/x/ddc_vim@v4.0.2/deps.ts";
const { garbagecollect } = fn;

Cleanup unused Lists, Dictionaries, Channels and Jobs that have circular references.

There is hardly ever a need to invoke this function, as it is automatically done when Vim runs out of memory or is waiting for the user to press a key after 'updatetime'. Items without circular references are always freed when they become unused. This is useful if you have deleted a very big List and/or Dictionary with circular references in a script that runs for a long time.

When the optional {atexit} argument is one, garbage collection will also be done when exiting Vim, if it wasn't done before. This is useful when checking for memory leaks.

The garbage collection is not done immediately but only when it's safe to perform. This is when waiting for the user to type a character. To force garbage collection immediately use test_garbagecollect_now().

Parameters

denops: Denops
optional
atexit: unknown

Returns

Promise<void>