The R Project SVN R

Rev

Rev 37088 | Rev 38022 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37088 Rev 37702
Line 1124... Line 1124...
1124
 
1124
 
1125
/* R interface function */
1125
/* R interface function */
1126
 
1126
 
1127
SEXP attribute_hidden do_regFinaliz(SEXP call, SEXP op, SEXP args, SEXP rho)
1127
SEXP attribute_hidden do_regFinaliz(SEXP call, SEXP op, SEXP args, SEXP rho)
1128
{
1128
{
-
 
1129
    int onexit;
-
 
1130
    
1129
    checkArity(op, args);
1131
    checkArity(op, args);
1130
 
1132
 
1131
    if (TYPEOF(CAR(args)) != ENVSXP && TYPEOF(CAR(args)) != EXTPTRSXP)
1133
    if (TYPEOF(CAR(args)) != ENVSXP && TYPEOF(CAR(args)) != EXTPTRSXP)
1132
	errorcall(call, _("first argument must be environment or external pointer"));
1134
	errorcall(call, _("first argument must be environment or external pointer"));
1133
    if (TYPEOF(CADR(args)) != CLOSXP)
1135
    if (TYPEOF(CADR(args)) != CLOSXP)
1134
	errorcall(call, _("second argument must be a function"));
1136
	errorcall(call, _("second argument must be a function"));
-
 
1137
 
-
 
1138
    onexit = asLogical(CADDR(args));
-
 
1139
    if(onexit == NA_LOGICAL)
-
 
1140
	errorcall(call, _("third argument must be 'TRUE' or 'FALSE'"));
1135
    
1141
    
1136
    R_RegisterFinalizer(CAR(args), CADR(args));
1142
    R_RegisterFinalizerEx(CAR(args), CADR(args), onexit);
1137
    return R_NilValue;
1143
    return R_NilValue;
1138
}
1144
}
1139
 
1145
 
1140
 
1146
 
1141
/* The Generational Collector. */
1147
/* The Generational Collector. */