Re: [Rd] Heap access across multiple calls from R to C++

2023-05-23 Thread Ivan Krylov
On Wed, 24 May 2023 02:08:25 +0200 wrote: > initialize = function() { > > .C("make_native_obj", self$native_obj) > > }) > extern "C" void make_native_obj(double *obj) { > > auto native_obj = new NativeObjStruct(); > > memcpy(obj, &native_obj, sizeof(obj)); > > } > Is there a

[Rd] Heap access across multiple calls from R to C++

2023-05-23 Thread pikappa.devel
Dear all, I have a question about maintaining state in native code during the lifetime of an object of R6Class type. The background is the following. I have a class derived from the standard model class of the R port of Keras, and I want to perform some calculations in native code using a third

Re: [Rd] How to locate references to an environment?

2023-05-23 Thread Tomas Kalibera
On 5/23/23 20:29, Peter Meilstrup wrote: R developers, I am trying to track down a memory leak in my R package. I have a complex object O which comprises a lot of closures and such. Among which, the object uses an environment E to perform computations and keep intermediate values in. When O c

Re: [Rd] How to locate references to an environment?

2023-05-23 Thread Duncan Murdoch
On 23/05/2023 2:29 p.m., Peter Meilstrup wrote: R developers, I am trying to track down a memory leak in my R package. I have a complex object O which comprises a lot of closures and such. Among which, the object uses an environment E to perform computations and keep intermediate values in. Whe

[Rd] How to locate references to an environment?

2023-05-23 Thread Peter Meilstrup
R developers, I am trying to track down a memory leak in my R package. I have a complex object O which comprises a lot of closures and such. Among which, the object uses an environment E to perform computations and keep intermediate values in. When O closes/finishes with its task it nulls out its