search for: reprotect

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

2017 Jun 06
2
Usage of PROTECT_WITH_INDEX in R-exts
...; > but I believe it has to be > > > PROTECT_WITH_INDEX(s = eval(OS->R_fcall, OS->R_env), &ipx); > > > because PROTECT_WITH_INDEX() returns void. > > Yes indeed, thank you Kirill! > > note that the same is true for its partner function|macro REPROTECT() > > However, as PROTECT() is used a gazillion times and > PROTECT_WITH_INDEX() is used about 100 x less, and PROTECT() > *does* return the SEXP, > I do wonder why PROTECT_WITH_INDEX() and REPROTECT() could not > behave the same as PROTECT() > (a view at the source code seem...
2003 Oct 31
2
How to grow an R object from C (.Call Interface)
What is the best way to grow an R return object in writing a C function using the Rdefines.h macros. In my application, the final size of the return object is not known during construction. My understanding 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
2017 Jun 05
2
Usage of PROTECT_WITH_INDEX in R-exts
Hi I've noted a minor inconsistency in the documentation: Current R-exts reads s = PROTECT_WITH_INDEX(eval(OS->R_fcall, OS->R_env), &ipx); but I believe it has to be PROTECT_WITH_INDEX(s = eval(OS->R_fcall, OS->R_env), &ipx); because PROTECT_WITH_INDEX() returns void. Best regards Kirill
2017 Jun 09
1
Usage of PROTECT_WITH_INDEX in R-exts
...S->R_env), >>> &ipx); >>> >>> > because PROTECT_WITH_INDEX() returns void. >>> >>> Yes indeed, thank you Kirill! >>> >>> note that the same is true for its partner >>> function|macro REPROTECT() >>> >>> However, as PROTECT() is used a gazillion times and >>> PROTECT_WITH_INDEX() is used about 100 x less, and >>> PROTECT() *does* return the SEXP, I do wonder why >>> PROTECT_WITH_INDEX() and REPROTECT() could not behave...
2017 Jun 06
0
Usage of PROTECT_WITH_INDEX in R-exts
...->R_fcall, OS->R_env), &ipx); > but I believe it has to be > PROTECT_WITH_INDEX(s = eval(OS->R_fcall, OS->R_env), &ipx); > because PROTECT_WITH_INDEX() returns void. Yes indeed, thank you Kirill! note that the same is true for its partner function|macro REPROTECT() However, as PROTECT() is used a gazillion times and PROTECT_WITH_INDEX() is used about 100 x less, and PROTECT() *does* return the SEXP, I do wonder why PROTECT_WITH_INDEX() and REPROTECT() could not behave the same as PROTECT() (a view at the source code seems to suggest a change to be trivia...
2017 Jun 08
0
Usage of PROTECT_WITH_INDEX in R-exts
...to be >> >> > PROTECT_WITH_INDEX(s = eval(OS->R_fcall, OS->R_env), &ipx); >> >> > because PROTECT_WITH_INDEX() returns void. >> >> Yes indeed, thank you Kirill! >> >> note that the same is true for its partner function|macro REPROTECT() >> >> However, as PROTECT() is used a gazillion times and >> PROTECT_WITH_INDEX() is used about 100 x less, and PROTECT() >> *does* return the SEXP, >> I do wonder why PROTECT_WITH_INDEX() and REPROTECT() could not >> behave the same as PROTECT() >> (a...
2005 Apr 16
1
SET_LENGTH
Hello. I'm trying to read a delimited file. I'm a little new to the R api. In the program, I do something like this... /*****************************/ SEXP retval; PROTECT(retval = allocMatrix(STRSXP,1,names.dim)); int r_eltctr = 0; while(!myfile.eof()) { SET_LENGTH(retval,r_eltctr+num_of_fields); for(int i = 0;numofcolumns; ++i) { INTEGER(retval)[r_eltctr++] = 1;/*some
2003 Dec 12
3
C++: Appending Values onto an R-Vector.
Hi folks. I posted this question a few days ago, but maybe it got lost because of the code I included with it. I'm having a problem using the SET_LENGTH() macro in an R extension I'm writing in C++. In a function within the extension I use SET_LENGTH() to resize R vectors so as to allow the concatenation of single values onto the vectors -- it's a "push back" function to
2013 Nov 05
1
Dynamic list creation (SEXP in C) returns error "unimplemented type (29) in 'duplicate'"
...post in Stackoverflow http://stackoverflow.com/questions/7458364/growing-an-r-matrix-inside-a-c-loop/7458516#7458516 I understood that it was necesary to (1) create the "child lists" and protecting them with PROTECT_WITH_INDEX, and (2) changing its size using SETLENGTH (Rf_lengthgets) and REPROTECT ing the lists in order to tell the GC that the vectors had change. THIRD: Once my two vectors are done ("id" and "lambda"), assign them to the i-th element of the "mother list" L1 using SET_VECTOR_ELT(VECTOR_ELT(L1,i), 0, duplicate(id)); SET_VECTOR_ELT(VECTOR_ELT(...
2010 Aug 23
1
Speed improvement to PROTECT, UNPROTECT, etc.
...tackTop >= (n) ? \ (void) (R_PPStackTop -= (n)) : Rf_unprotect(n)) #define PROTECT_WITH_INDEX(x,i) do { \ PROTECT(x); \ *(i) = R_PPStackTop - 1; \ } while (0) #define REPROTECT(x,i) ( (void) (R_PPStack[i] = x) ) Unfortunately, one can't just change the definitions in Rinternals.h. Some uses of PROTECT are in places where R_PPStack, etc. aren't visible. Instead, one can redefine them at the end of Defn.h, where these variables are declared. That alone also doesn...
2007 Apr 18
0
[PATCH 5/9] 00mm6 kpte flush.patch
...e subtly, reverse the order of the flush for kmap_atomic. Instead of flushing on establishing a mapping, flush on clearing a mapping. This eliminates the possibility of leaving stale kmap entries which may still have valid TLB mappings. This is required for direct mode hypervisors, which need to reprotect all mappings of a given page when changing the page type from a normal page to a protected page (such as a page table or descriptor table page). But it also provides some nicer semantics for real hardware, by providing extra debug-proofing against using stale mappings, as well as ensuring that no...
2002 Jun 12
1
identical calls are not equal !?
Can please someone familiar with the R internals enlighten me on the following strange observation: # this is IDENTICAL as expected identical(substitute(substitute()), substitute(substitute())) # but NOT EQUAL !???? substitute(substitute()) == substitute(substitute()) # I originally found it on t2 <- function(e){ substitute(e) } t2(substitute(x==y, list(y=y)))[1] # I would expect all
2014 Mar 06
2
A question about multiple(?) out of order ReleaseObject
Hello, This is a question that probably reveals my lack of understanding. In a C function (call it cfunc), i created a SEXP, called S, and then called R_PreserveObject on S. I returned the SEXP to the calling R function (call it rfunc). Note, I didn't call R_ReleaseObject on S. v <- .Call("cfunc") So, are the following statements correct 1. S is 'doubly' protected
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
2004 Aug 12
4
truly object oriented programming in R
Good morning! I recently implemented a KD tree in JAVA for faster kernel density estimation (part of the code follows). It went well. To hook it with R, however, has proved more difficult. My question is: is it possible to implement the algorithm in R? My impression seems to indicate no as the code requires a complete class-object framework that R does not support. But is there an R package or
2013 Apr 03
0
R 3.0.0 is released
...The entry points rgb2hsv and hsv2rgb have been migrated to package grDevices and so are no longer available. o R_GE_version has been increased to 10 and name2col removed (use R_GE_str2col instead). R internal colour codes are now defined using the typedef rcolor. o The REPROTECT macro now checks that the protect index is valid. o Several non-API entry points no longer used by R have been removed, including the Fortran entry points chol, chol2inv, cg, ch and rg, and the C entry points Brent_fmin, fft_factor and fft_work. o If a .External call is...
2013 Apr 03
0
R 3.0.0 is released
...The entry points rgb2hsv and hsv2rgb have been migrated to package grDevices and so are no longer available. o R_GE_version has been increased to 10 and name2col removed (use R_GE_str2col instead). R internal colour codes are now defined using the typedef rcolor. o The REPROTECT macro now checks that the protect index is valid. o Several non-API entry points no longer used by R have been removed, including the Fortran entry points chol, chol2inv, cg, ch and rg, and the C entry points Brent_fmin, fft_factor and fft_work. o If a .External call is...
2006 Jul 25
18
[PATCH] turn off writable page tables
At OLS I gave a talk on some of the Xen scalability inhibitors, and one of these was writable page tables. We went over why the feature does not scale, but just as important, we found that the uniprocessor case does not provide any advantage either. These tests were done on x86_64, so I wanted to run the 1-way test on 32 bit to show the same problem. So, I have run with writable PTs and