search for: _finalizer

Displaying 1 result from an estimated 1 matches for "_finalizer".

Did you mean: finalizer
2016 May 14
2
R external pointer and GPU memory leak problem
...?temp = REAL(input); double *x; ? ? ? ? ? ? ? ##here is the step which causes the memory leak cudacall(cudaMalloc((void**)&x, *lenth * sizeof(double))); //protect the R external pointer from finalizer SEXP ext = PROTECT(R_MakeExternalPtr(x, R_NilValue, R_NilValue)); R_RegisterCFinalizerEx(ext, _finalizer, TRUE); ? //copying CPU to GPU cublascall(cublasSetVector(*lenth, sizeof(double), temp, 1,? R_ExternalPtrAddr(ext), 1)); ? ? ? ? ? ?UNPROTECT(2); return ext; } here is my finalized for my create function, /* define finalizer for R external pointer input is R external pointer, function will fina...