Where do I find the definition of Rf_protect() in R's sources? -
i reading r sources , trying learn heap structure. i'm looking definition of protect(), i've founded:
$ grep -rn "#define protect(" * src/include/rinternals.h:642:#define protect(s) rf_protect(s)
and then
$ grep -rn "rf_protect(" * src/include/rinternals.h:803:sexp rf_protect(sexp); src/include/rinternals.h:1267:sexp rf_protect(sexp);
but didn't find rf_protect()'s definition.
thanks.
the rf_
prefix common idiom giving plain c code resemblance of namespace. want protect(...)
instead:
/usr/share/r/include/rinternals.h:#define protect rf_protect
and given how 'core' this, may start in src/main
quick grep -c
leads src/main/memory.c
. et voila on lines 3075 3081
sexp protect(sexp s) { if (r_ppstacktop >= r_ppstacksize) r_signal_protect_error(); r_ppstack[r_ppstacktop++] = chk(s); return s; }
now said, want pay attention of file , not function.
Comments
Post a Comment