Commit 260fe0f5 authored by Radford Neal's avatar Radford Neal

make part of endcontext not inline

parent bb355575
......@@ -319,19 +319,23 @@ void begincontext(RCNTXT * cptr, int flags,
/* endcontext - end an execution context. */
void endcontext(RCNTXT * cptr)
static void attribute_noinline endcontext_onexit (RCNTXT *cptr)
{
SEXP s = cptr->conexit;
Rboolean savevis = R_Visible;
cptr->conexit = R_NilValue; /* prevent recursion */
PROTECT(s);
eval(s, cptr->cloenv);
UNPROTECT(1);
R_Visible = savevis;
}
void endcontext(RCNTXT *cptr)
{
R_HandlerStack = cptr->handlerstack;
R_RestartStack = cptr->restartstack;
if (cptr->conexit != R_NilValue && cptr->cloenv != R_NilValue) {
SEXP s = cptr->conexit;
Rboolean savevis = R_Visible;
cptr->conexit = R_NilValue; /* prevent recursion */
PROTECT(s);
eval(s, cptr->cloenv);
UNPROTECT(1);
R_Visible = savevis;
}
if (cptr->conexit != R_NilValue && cptr->cloenv != R_NilValue)
endcontext_onexit(cptr); /* not inline, since not the common case */
R_GlobalContext = cptr->nextcontext;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment