similar to: reg.finalizer(): Multiple finalizers?

Displaying 20 results from an estimated 5000 matches similar to: "reg.finalizer(): Multiple finalizers?"

2011 Mar 16
0
.libPaths() on Windows may return duplicated paths
In R v2.12.2 patched (2011-03-13 r54787) and also in R v2.13.0 devel (2011-03-15 r54806), .libPaths() may return the multiple paths referring to the same "normalized" path name. Here is an example from Rterm --vanilla using R v2.12.2 patched: > paths <- .libPaths(c("C:/", "C:\\")) > paths [1] "C:/" [2] "C:\\" [3]
2011 Jun 07
1
Cases of TAB-completion that hang Rterm
FYI, via a bug report of one of my packages, I discovered that the following cases will hang Rterm when using TAB completion: CASE #1: Adding an empty default function for tail() causes Rterm on Windows to hang if one press TAB at the prompt: % Rterm -vanilla > tail.default <- function(...) {} > [PRESS TAB] Error in specialOpLocs(text) : (list) object cannot be coerced to type
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 =
2013 Oct 13
0
reg.finalizer(): Is it safe for the finalizer function to attach/load a package?
>From the help/docs it is pretty clear that one could/should only assume that the 'base' namespace is available when a finalizer function is evaluated. What is not clear to me is whether you can safely attach/load packages in your finalizer function. For example, are the following finalizer functions safe? reg.finalizer(e, function(e, ...) { library("tcltk")
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,
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
2013 Feb 13
2
stopping finalizers
Is there some way to prevent finalizers running during a section of code? I have a package that includes R objects linked to database tables. To maintain the call-by-value semantics, tables are copied rather than modified, and the extra tables are removed by finalizers during garbage collection. However, if the garbage collection occurs in the middle of processing another SQL query (which is
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
2015 Nov 25
0
Custom C finalizers for .Call
Jeroen, I agree that it may be useful to have some kind of "finally"-like infrastructure. However, in the use cases you list there are already ways to do that - the same way that R_alloc uses. First, you don't need to call UNPROTECT - the whole point is that the protection stack is automatically popped in case of an abnormal termination. That is precisely how memory leaks are
2020 Apr 03
0
[External] The finalizer of the externalPtr does not work when closing R?
Use R_RegisterFinalizerEx in your C code. See https://cran.r-project.org/doc/manuals/r-release/R-exts.html#External-pointers-and-weak-references This still gives you only "best effort"; for anything stronger you would need a different approach. In general, finalizers should only be used as a backstop, not as a primary resource management tool (in R or any other garbage-collected
2006 Feb 20
0
Object Finalizers help
Heya guys, This one is bothering me as its evading my eye. I''m trying to set a callback on finalization of an object, ie: a finalizer set through a plugin to the model. Example In Plugin: def acts_as_goat class_eval do ObjectSpace.define_finalizer(self, Proc.new {self.conn.close} ) end end class UberGoat < ActiveRecord::Base acts_as_goat end Anyways, it seems to not
2011 Jan 21
0
[LLVMdev] [LLVMDev] Reg Alloc: Spiller::Spill question
Jeff Kunkel <jdkunk3 at gmail.com> writes: > Spiller::Spill( LiveInterval *li, >                           SmallVectorImpl<LiveInterval*> &newIntervals, >                           const SmallVectorImpl<LiveInterval*> &spillIs ); > > has two reference vectors which contain a small list of Live > Intervals. What is the register allocator's job to do
2005 Jul 26
1
Error registering finalizer
What exactly is a reference object? I'm getting this error message attempting to register a finalizer: can only weakly reference/finalize reference objects I don't see any problem with the code... Here's what appears to be the relevant portions. setClass("PDNNObject", representation(handle = "externalptr", id =
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
2019 Jun 08
0
Determining the exit code of an "almost finished" R script
On 08/06/2019 9:55 a.m., Gergely Dar?czi wrote: > On Sat, Jun 8, 2019 at 2:13 PM Duncan Murdoch <murdoch.duncan at gmail.com> wrote: >> >> On 08/06/2019 7:42 a.m., Gergely Dar?czi wrote: >>> Dear All, >>> >>> I'm using "reg.finalizer" in a function that is to be called in R scripts >>> to do some cleanup on success. I have not
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
2011 Jun 13
4
remove commas in a number when reading a text file
Hello, I'm running version R x64 v2.12.2 on a 64bit windows 7 PC. I'm trying to read a text file using read.table where the values have a format like "1,234,567". What I want is "1234567". Is there a quick way to strip out the commas? I can use strsplit and paste, but the file is quite large and would take some time. Thanks. Eric [[alternative HTML version
2020 Apr 03
0
The finalizer of the externalPtr does not work when closing R?
See R_RegisterCFinalizerEx() and set onexit to nonzero. Here: https://github.com/wch/r-source/blob/9353ddfa8d30069ad8975e0364307d710f2488d5/src/include/Rinternals.h#L1279-L1280 Gabor On Fri, Apr 3, 2020 at 1:56 PM Wang Jiefei <szwjf08 at gmail.com> wrote: > > Hi all, > > I found that the finalizer of the externalPtr is not called when R is > quitting. However, manually
2011 Nov 18
3
Windows binaries: Version and revision strings show "(2006-00-00 r00000)"
FYI, for the last few revision the version string for both R v2.14.0 patched and R devel are not correct for the Windows binaries. This is what R --version and sessionInfo() report since a couple of days: R version 2.14.0 Patched (2006-00-00 r00000) R Under development (unstable) (2006-00-00 r00000) Also, "r00000" is listed as the revision on:
2011 Oct 18
1
How to read data sequentially into R (line by line)?
I have a data set like this in one .txt file (cols separated by !): APE!KKU!684! APE!VAL!! APE!UASU!! APE!PLA!1! APE!E!10! APE!TPVA!17122009! APE!STAP!1! GG!KK!KK! APE!KKU!684! APE!VAL!! APE!UASU!! APE!PLA!1! APE!E!10! APE!TPVA!17122009! APE!STAP!1! GG!KK!KK! APE!KKU!684! APE!VAL!! APE!UASU!! APE!PLA!1! APE!E!10! APE!TPVA!17122009! APE!STAP!1! GG!KK!KK! it contains over 14 000 000 records. Now