Displaying 20 results from an estimated 9000 matches similar to: "stopping finalizers"
2016 Sep 15
1
Finalizer execution order question
Given an externalptr object 'pool' which protects an R object 'prot':
# SEXP prot = (a dynamically updated list with handles)
SEXP pool = R_MakeExternalPtr(p, R_NilValue, prot);
R_RegisterCFinalizerEx(pool, fin_pool, TRUE);
WRE explains that 'prot' remains in existence as long as 'pool' is
around. Does this also mean 'prot' still exists when the
2016 Aug 06
1
vector finalizers
Dear R Devel,
In a thread this morning Luke Tierney mentioned that R's way of
garbage collecting is going to change soon in 3.4.0. I couldn't find
this info on Google but I wanted to share what I had been discussing
in another forum, in case now is not too late to raise considerations
which could affect the design of planned changes to R's garbage
collection facilities.
I ran into a
2018 Aug 09
2
SIGSEGV in R_RunWeakRefFinalizer, object allocated with Rcpp
Thanks, Tomas, Luke, for the clarifications. Then, I have another question.
But first, let me introduce how I ended up here, because obviously I
just don't go around dyn.unloading things that I've just compiled. I
was testing a package with valgrind. Everything ok, no leaks. Great.
But I'm always suspicious (probably unjustifiably) of all the memory
that is reported as "still
2011 Jul 22
1
reg.finalizer and connection gc -- which runs when (and why)?
With this set-up
options(warn = 1)
tf <- tempfile()
finalizer <- function(obj) {
message("finalizer")
close(obj$f)
}
this code works
ev <- new.env()
ev$f <- file(tf, "w")
reg.finalizer(ev, finalizer)
rm(ev)
gc()
whereas this (reversing the order of file() and reg.finalizer())
ev <- new.env()
reg.finalizer(ev, finalizer)
ev$f <- file(tf,
2015 Nov 23
4
Custom C finalizers for .Call
WRE explains that R_alloc() can be used to allocate memory which
automatically gets released by R at the end of a .C, .Call or
.External, even in the case of an error or interruption. This is a
really great feature to prevent memory leaks. I was wondering if there
is a way to extend this mechanism to allow for automatically running
UNPROTECT and custom finalizers at the end of a .Call as well.
2020 Apr 03
4
The finalizer of the externalPtr does not work when closing R?
Hi all,
I found that the finalizer of the externalPtr is not called when R is
quitting. However, manually calling GC() works fine. This behavior is
observed on devel R 2020-04-02 r78142 on Win and R 3.6.3 on Ubuntu. I make
a reproducible package here: https://github.com/Jiefei-Wang/example
Here is the detail of how to reproduce the problem, I create a temporary
file in the package root path and
2018 Aug 09
4
SIGSEGV in R_RunWeakRefFinalizer, object allocated with Rcpp
On 9 August 2018 at 20:37, Tomas Kalibera wrote:
| So to answer your original question, this could probably be handled in
| Rcpp,
Hm. Why do you say that / what did you have in mind?
Recall that we do not alter SEXPs or introduce additional additional
reference counters -- because we do not think that altering the basic R API
for such calls would be a wise strategy. So we do more or less what
2018 Mar 27
2
Objects not gc'ed due to caching (?) in R's S3 dispatch mechanism
I have committed a change to R-devel that addresses this. To be on the
safe side I need to run some more extensive tests before deciding if
this can be ported to the release branch for R 3.5.0. Should know in a
day or two.
Best,
luke
On Tue, 27 Mar 2018, luke-tierney at uiowa.edu wrote:
> This has nothing to do with printing or dispatch per se. It is the
> result of an internal register
2014 Oct 27
1
proper use of reg.finalizer to close connections
Hi all, I have a question about finalizers...
I have a package that manages state for a few connections, and I'd
like to ensure that these connections are 'cleanly' closed upon either
(i) R quitting or (ii) an unloading of the package.
So, in a pared-down example package with a single R file, it looks
something like:
##### BEGIN PACKAGE CODE #####
.CONNS <- new.env(parent =
2001 Jul 10
1
Object finalization
I see some code in R to attach finalizers to external pointer references
(Register[C]Finalizer). Anyone have an example of how to code the
finalizer? R_RegisterCFinalizer accepts a C function, but I can't see
how to get it to operate on the pointer, since the pointer is not passed
to the function when its called. RegisterFinalizer takes an R closure,
but how is it called from R (tried
2018 Mar 26
4
Objects not gc'ed due to caching (?) in R's S3 dispatch mechanism
Hi,
I initially opened an issue in the R6 repo because my issue was with
an R6 object. But Winston (thanks!) further simplified my example, and
it turns out that the issue (whether a feature or a bug is yet to be
seen) had to do with S3 dispatching.
The following example, by Winston, depicts the issue:
print.foo <- function(x, ...) {
cat("print.foo called\n")
invisible(x)
}
2011 Apr 02
0
reg.finalizer(): Multiple finalizers?
Hi,
I've got some questions regarding finalizers registered using
reg.finalizer(). I have a setup where in certain cases I wish to set
a new finalizer to an object that already got one. Since there is no
API for removing/replacing already registered finalizers (have been
"requested" previously on this list), I have basically just added a
new finalizer by calling reg.finalizer() a
2007 Aug 03
2
How to properly finalize external pointers?
Dear R .Call() insiders,
Can someone enlighten me how to properly finalize external pointers in C code (R-2.5.1 win)? What is the relation between R_ClearExternalPtr and the finalizer set in R_RegisterCFinalizer?
I succeeded registering a finalizer that works when an R object containing an external pointer is garbage collected. However, I have some difficulties figuring out how to do that in an
2004 May 03
1
Finalization and external pointers
I'm adding things to the Windows RGui so that there's more control of
the interface from within R.
One thing I'm considering is giving access to the Graphapp window
objects using external pointers. This raises the issue of
finalization on both sides:
- If someone creates a pointer referring to a window, then that
pointer should be changed to NULL when the window is closed.
- If
2018 Mar 27
2
Objects not gc'ed due to caching (?) in R's S3 dispatch mechanism
2018-03-27 6:02 GMT+02:00 <luke-tierney at uiowa.edu>:
> This has nothing to do with printing or dispatch per se. It is the
> result of an internal register (R_ReturnedValue) being protected. It
> gets rewritten whenever there is a jump, e.g. by an explicit return
> call. So a simplified example is
>
> new_foo <- function() {
> e <- new.env()
>
2001 Mar 07
2
smbmount - file permissions on RH7
Greetings in Christ our Saviour.
I am having an enormous amount of difficulties trying to do something that
should be quite easy. Obviously, I am missing something. I have read
everything I can find on this, and have tried everything I can think of and
more...
I am trying to mount a Win98 drive on my Redhat 7.0 box. The mounting is no
problem. However, when I log into my user account and try
2018 Mar 27
1
Objects not gc'ed due to caching (?) in R's S3 dispatch mechanism
2018-03-27 11:11 GMT+02:00 Tomas Kalibera <tomas.kalibera at gmail.com>:
> On 03/27/2018 09:51 AM, I?aki ?car wrote:
>>
>> 2018-03-27 6:02 GMT+02:00 <luke-tierney at uiowa.edu>:
>>>
>>> This has nothing to do with printing or dispatch per se. It is the
>>> result of an internal register (R_ReturnedValue) being protected. It
>>> gets
2008 Mar 27
1
snow, stopping cluster
Hello,
is there any function in the package snow to check for a really running
cluster?
The function checkCluster only checks the variable cl. And the variable
is still available after stopping the cluster!
( a simple solution would be deleting the cluster variable cl in the
function stopCluster)
> library(snow)
> cl <- makeCluster(5)
5 slaves are spawned successfully. 0
2002 Jan 31
2
Help with Bootstrap function.
Dear List
I am using R with mcgv package to model spatial variation in density estimates of dorcas gazelle in Sinai. I have 59 points of data and 4 explanatory variables(distance from mountain edge, camel presence, Latitude & Longitude). I want to test the model fir via bootstraping. I have used the jacknife bootstraping but it have the limitation of allowing only 58 trials. I tried to use the
2004 Jun 14
5
mkChar can be interrupted
Hi,
As was discussed earlier in another thread and as documented in R-exts
.Call() should not be interruptible by Ctrl-C. However the following
code, which spends most of its time inside mkChar, turned out to be
interruptible on RH-7.3 R-1.8.1 gcc-2.96:
#include <Rinternals.h>
#include <R.h>
SEXP foo0(const SEXP nSexp) {
int i, n;
SEXP resSexp;
if (!isInteger(nSexp))