search for: unprotect_ptr

Displaying 18 results from an estimated 18 matches for "unprotect_ptr".

2003 Oct 31
2
How to grow an R object from C (.Call Interface)
...g is that each time I grow an R object I have to use PROTECT() again, probably before UNPROTECTing the smaller version. However, due to the stack character of the PROTECT mechanism, UNPROTECT would not work to remove the smaller one, after the bigger has been protected. Is this an indication to use UNPROTECT_PTR ? Or is another approach recommended? May be the solution to this is worth a sentence in "Wrtiting R Extensions". Thanks for any help Jens Oehlschl?gel -- NEU F?R ALLE - GMX MediaCenter - f?r Fotos, Musik, Dateien... Fotoalbum, File Sharing, MMS, Multimedia-Gru?, GMX FotoService Je...
2009 Sep 22
2
cannot build R-devel (>= r49747)
...]: Entering directory `/tmp/R-devel/src/library/base' building package 'base' make[4]: Entering directory `/tmp/R-devel/src/library/base' mkdir -p -- ../../../library/base/demo mkdir -p -- ../../../library/base/po make[4]: Leaving directory `/tmp/R-devel/src/library/base' Error: unprotect_ptr: pointer not found Execution halted make[3]: *** [all] Error 1 make[3]: Leaving directory `/tmp/R-devel/src/library/base' make[2]: *** [R] Error 1 make[2]: Leaving directory `/tmp/R-devel/src/library' make[1]: *** [R] Error 1 make[1]: Leaving directory `/tmp/R-devel/src' make: *** [R] E...
2008 Aug 04
2
Parsing code with newlines
...ng the following: void* my_compile(char *code) { SEXP cmdSexp, cmdExpr = R_NilValue; ParseStatus status; PROTECT (cmdSexp = allocVector (STRSXP, 1)); SET_STRING_ELT (cmdSexp, 0, mkChar (code)); PROTECT (cmdExpr = R_ParseVector (cmdSexp,-1,&status, R_NilValue)); UNPROTECT_PTR (cmdSexp); if (status != PARSE_OK) { return (void*)0; } else { return (void*)cmdExpr; } } Regards, Peter [[alternative HTML version deleted]]
2009 Jan 08
1
Callbacks seems to get GCed.
...void r_exec(char *code) { SEXP cmdSexp, cmdExpr = R_NilValue; ParseStatus status; int i,errorOccurred; SEXP e; PROTECT (cmdSexp = allocVector (STRSXP, 1)); SET_STRING_ELT (cmdSexp, 0, mkChar (code)); PROTECT (cmdExpr = R_ParseVector (cmdSexp,-1,&status,R_NilValue)); UNPROTECT_PTR (cmdSexp); if (status == PARSE_OK) { for (i = 0; i < length (cmdExpr); i++) { PROTECT(e = VECTOR_ELT (cmdExpr,i)); R_tryEval(e, R_GlobalEnv, &errorOccurred); UNPROTECT_PTR(e); if (errorOccurred) { return; } } } } void initR() { cha...
2006 Aug 07
2
Backquote in R syntax
...asking about that. But I got curious about what role the backquote might play in R syntax (if any). As a start I tried typing that in as it stands: source(`xyz.R') ## and then you get the "continuation +" as if it were ## incomplete, so I tried a closing parenthesis: + ) Error: unprotect_ptr: pointer not found So it wasn't a mere syntax error (which would have caused an error message saying just that) -- using the backquote caused R to try to do something. So now I'm wondering what the effect of "`" is, in R. Statutory Declaration: I have performed an R Site Search...
2004 Jul 06
1
Wrong object type produced - LANGSXP should be LISTSXP (PR#7055)
...static SEXP xxsubscript(SEXP a1, SEXP a2, SEXP a3) { SEXP ans; if (GenerateCode) - PROTECT(ans = LCONS(a2, LCONS(a1, CDR(a3)))); + PROTECT(ans = LCONS(a2, CONS(a1, CDR(a3)))); else PROTECT(ans = R_NilValue); UNPROTECT_PTR(a3); UNPROTECT_PTR(a1); return ans;
2008 Feb 23
0
patch: two minor debugging-related pointer protection stack issues (PR#10832)
...lem in normal use of R, and only under laughably implausible circumstances. (1) valgrind is given a wrong address when it is told to mark the reserved "red zone" portion of the PPS as "no access". This might generate spurious access errors while debugging under valgrind. (2) unprotect_ptr always does one more copy than necessary when collapsing the slot of the pointer it is unprotecting. This is but a trivial performance penalty unless the PPS is full, in which case it causes a read of the first word in the PPS red zone. If issue (1) were corrected, that would trigger a spurious va...
2012 Aug 24
1
CRAN check error with no example?
Hello, All: The CRAN checks for the "fda" package includes one error: The error most likely occurred in ... file.copy2 ... Error: unprotect_ptr: pointer not found Execution halted (http://www.r-project.org/nosvn/R.check/r-devel-linux-x86_64-debian/fda-00check.html) The help page for "file.copy2" includes "\examples" with everything wrapped in "\dontrun". I'm unable to replicate this er...
2013 Oct 16
1
Parallel R expression evaluations
...I am using R-3.0.1 under Linux platform to embed R into my C++ code. I am facing an error while executing more than 1 R-expressions parallelly. I am executing round(X) and abs(X) parallelly on a set of 50 input rows which resulted in segmentation fault after getting the following errors. Error: unprotect_ptr: pointer not found Error: argument to 'findVar' is not an environment I am using the following code snippet for initializing R, parsing and evaluation of R expression // For initialization int res= Rf_initEmbeddedR(R_argc, (char**)R_argv); // For parsing and evaluation...
2009 Nov 28
1
PROTECT and OCaml GC.
Hello. In the writing of my OCaml-R binding, I'm sort of confused when it comes to the use of the PROTECT and UNPROTECT macros. Basically, I have C stub functions that are in charge of calling R for everything. Here's a simple example: > CAMLprim value r_findvar (value symbol) { > /* The findVar function is defined in envir.c. It looks up a symbol > in an environment.
2010 Jan 02
3
R-devel Digest, Vol 83, Issue 2
[Disclaimer: what is below reflects my understanding from reading the R source, others will correct where deemed necessary] On 1/2/10 12:00 PM, r-devel-request at r-project.org wrote: > > Hello, > > We are currently making lots of changes to Rcpp (see the open Rcpp > mailing list if interested [1] in the details). > > We are now using [2] R_PreserveObject and R_ReleaseObject
2003 Dec 10
0
C++: SET_LENGTH() Over Many Iterations?
...-vector memory and write to the reserved slots; i.e., I'm not trying to create an R object too big to be handled by R within the context of my OS's available memory. Here's some simple test code I've been running: <CPP Code> #define PUSH_BACK_INTEGER(v, x) \ do {\ UNPROTECT_PTR(v);\ SET_LENGTH(v, GET_LENGTH(v) + 1);\ PROTECT(v);\ INTEGER_POINTER(v)[GET_LENGTH(v) - 1] = x;\ }\ while (false) SEXP R_SimplePushBackTest(SEXP args) { SEXP arg1, arg2, int_vect; PROTECT(arg1 = AS_INTEGER(CADR(args))); int n_reps = INTEGER_POINTER(arg1)[...
2015 Sep 19
0
New version of the R parser in pqR
...ions, but this also is easily removed if desired. The new parser operates top-down, by recursive descent, rather than using a bottom-up parser generated by Bison. This allows for much cleaner operation in several respects. Use of PROTECT can now follow the usual conventions, with no need to use UNPROTECT_PTR. Creation of parse data records is relatively straightforward. The special handling of newlines is also comparatively easy, without the need to embed a rudimentary top-down parser within the lexical analyser, as was done in the Bison parser. The old read-eval-print loop operates by calling the p...
2000 May 30
2
Documentatio: typo in Writing R Extensions (PR#557)
Full_Name: stephen eglen Version: 1.0.0 OS: Unix (OSF/1) Submission from: (NULL) (129.215.238.26) Hi, in the documentation `Writing R Extensions', the section 3.6.1 (handling the effects of garbage collection) has the following typo: Protecting a SEXP pointer protexts ... Should that be `protects'? -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
2013 Dec 16
1
External pointers and changing SEXPTYPE
Dear Developers, I've been struggling through writing R extension in C. I've been using an external pointer to store my data (please see sample below). I encountered a very weird erroneous behaviour: when I tried to use my external pointer to a structure holding several types of data, including SEXPs, I discovered that SEXPs change their types between returning from initialization
2019 Apr 26
0
R 3.6.0 is released
...D build has a new option --compression to select the compression used for the tarball. * R CMD build now removes src/*.mod files on all platforms. C-LEVEL FACILITIES: * New pointer protection C functions R_PreserveInMSet and R_ReleaseFromMSet have been introduced to replace UNPROTECT_PTR, which is not safe to mix with UNPROTECT (and with PROTECT_WITH_INDEX). Intended for use in parsers only. * NAMEDMAX has been raised to 7 to allow further protection of intermediate results from (usually ill-advised) assignments in arguments to BUILTIN functions. Proper...
2019 Apr 26
0
R 3.6.0 is released
...D build has a new option --compression to select the compression used for the tarball. * R CMD build now removes src/*.mod files on all platforms. C-LEVEL FACILITIES: * New pointer protection C functions R_PreserveInMSet and R_ReleaseFromMSet have been introduced to replace UNPROTECT_PTR, which is not safe to mix with UNPROTECT (and with PROTECT_WITH_INDEX). Intended for use in parsers only. * NAMEDMAX has been raised to 7 to allow further protection of intermediate results from (usually ill-advised) assignments in arguments to BUILTIN functions. Proper...
2019 Apr 26
0
R 3.6.0 is released
...D build has a new option --compression to select the compression used for the tarball. * R CMD build now removes src/*.mod files on all platforms. C-LEVEL FACILITIES: * New pointer protection C functions R_PreserveInMSet and R_ReleaseFromMSet have been introduced to replace UNPROTECT_PTR, which is not safe to mix with UNPROTECT (and with PROTECT_WITH_INDEX). Intended for use in parsers only. * NAMEDMAX has been raised to 7 to allow further protection of intermediate results from (usually ill-advised) assignments in arguments to BUILTIN functions. Proper...