Re: [Rd] Objects not gc'ed due to caching (?) in R's S3 dispatch mechanism

2018-03-29 Thread luke-tierney
Now also committed to the release branch. Best, luke On Tue, 27 Mar 2018, luke-tier...@uiowa.edu wrote: 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.

Re: [Rd] Objects not gc'ed due to caching (?) in R's S3 dispatch mechanism

2018-03-29 Thread luke-tierney
Now also committed to the release branch. Best, luke On Tue, 27 Mar 2018, luke-tier...@uiowa.edu wrote: 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.

Re: [Rd] Objects not gc'ed due to caching (?) in R's S3 dispatch mechanism

2018-03-27 Thread luke-tierney
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-tier...@uiowa.edu wrote: This has

Re: [Rd] Objects not gc'ed due to caching (?) in R's S3 dispatch mechanism

2018-03-27 Thread Tomas Kalibera
On 03/27/2018 11:53 AM, Iñaki Úcar wrote: 2018-03-27 11:11 GMT+02:00 Tomas Kalibera : On 03/27/2018 09:51 AM, Iñaki Úcar wrote: 2018-03-27 6:02 GMT+02:00 : This has nothing to do with printing or dispatch per se. It is the result of an internal register (R_ReturnedValue) being protected. It g

Re: [Rd] Objects not gc'ed due to caching (?) in R's S3 dispatch mechanism

2018-03-27 Thread Iñaki Úcar
2018-03-27 11:11 GMT+02:00 Tomas Kalibera : > On 03/27/2018 09:51 AM, Iñaki Úcar wrote: >> >> 2018-03-27 6:02 GMT+02:00 : >>> >>> 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

Re: [Rd] Objects not gc'ed due to caching (?) in R's S3 dispatch mechanism

2018-03-27 Thread Tomas Kalibera
On 03/27/2018 09:51 AM, Iñaki Úcar wrote: 2018-03-27 6:02 GMT+02:00 : 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

Re: [Rd] Objects not gc'ed due to caching (?) in R's S3 dispatch mechanism

2018-03-27 Thread Iñaki Úcar
2018-03-27 6:02 GMT+02:00 : > 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()

Re: [Rd] Objects not gc'ed due to caching (?) in R's S3 dispatch mechanism

2018-03-26 Thread luke-tierney
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() reg.finalizer(e

Re: [Rd] Objects not gc'ed due to caching (?) in R's S3 dispatch mechanism

2018-03-26 Thread Winston Chang
I'd like to emphasize that although Iñaki's example uses print(), it also happens with other S3 generics. Please note that each of the following examples might need to be run in a clean R session to work. === Here's an example that doesn't use S3 dispatch. The finalizer runs correctly. id

[Rd] Objects not gc'ed due to caching (?) in R's S3 dispatch mechanism

2018-03-26 Thread Iñaki Úcar
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