[R] anyone has C++ STL classes stability issue if used with R

2007-02-13 Thread Oleg Sklyar
Hello, is there any one who uses C++ STL classes when programming shared libs for R and has had any problems with STL? In the very simple example below I am constantly getting segfaults when trying to populate the queue. The segfault occurs at what looks like a random index in the loop when

[R] anyone has C++ STL classes stability issue if used with R

2007-02-13 Thread Oleg Sklyar
Continued: With the following modifications (using pointers) it works (needs memory cleaning afterwards and new less operator though) and I do not understand why: typedef priority_queuePixel * PixelPrQueue; ... pq.push( new Pixel(i, j, val) ); ... Oleg Sklyar wrote: Hello, is there any one

Re: [R] anyone has C++ STL classes stability issue if used with R

2007-02-13 Thread Duncan Murdoch
On 2/13/2007 3:55 AM, Oleg Sklyar wrote: Hello, is there any one who uses C++ STL classes when programming shared libs for R and has had any problems with STL? I don't, but I'd suggest asking a technical question like this on R-devel instead of R-help if you don't get help here. I can see

Re: [R] anyone has C++ STL classes stability issue if used with R

2007-02-13 Thread Oleg Sklyar
Duncan, you are right about Rf_..., otherwise the lengths are checked in the R side, this is just one of the functions I have in the package and all arguments are thoroughly checked. But apparently, the same code if redefined for using pointers instead of references works just perfectly fine