Skip to content

Instantly share code, notes, and snippets.

@joshuaulrich joshuaulrich/do_gc.c
Created Jan 28, 2018

Embed
What would you like to do?
Force an R garbage collection from C
void do_gc(SEXP env) {
SEXP s, t;
PROTECT(s = t = allocList(1));
SET_TYPEOF(s, LANGSXP);
SETCAR(t, install("gc")); t = CDR(t);
PrintValue(eval(s, env));
UNPROTECT(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.