Created
January 28, 2018 15:48
-
-
Save joshuaulrich/9dd96009b2cfb6f6b1dfce07461bfb97 to your computer and use it in GitHub Desktop.
Force an R garbage collection from C
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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