4 ms·
How does garbage collection work? Does this version improve on the R I know from a year ago, which had a reference counting system with only three values: 0, 1
by jzwinck 11y ago
How does garbage collection work? Does this version improve on the R I know from a year ago, which had a reference counting system with only three values: 0, 1, and 2+?
- rfergie 11y agohttps://tweag.github.io/HaskellR/docs/managing-memory.html https://tweag.github.io/HaskellR/docs/managing-memory.html https://tweag.github.io/HaskellR/docs/memory-allocation.html https://tweag.github.io/HaskellR/docs/memory-allocation.html Both these links have more information on this. As far as I can tell (and most of this is way over my head) the native R garbage collection is used
- mboes 11y agoYes - the R GC manages R objects allocated by the R interpreter, and conversely the Haskell GC manages Haskell objects allocated by the Haskell runtime.
- hadley 11y agoYou're confusing reference counting (which is used primarily for R's copy-on-modify strategy) and its generational garbage collector.
- jzwinck 11y agoIn that case, does HaskellR interfere with copy-on-modify in R, for example does it increment the reference count of R objects, then try to decrement them (which R doesn't or didn't really support), leaving those objects appearing to be multiply-referenced, and therefore forcing unnecessary copies as we see in plain R?