Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference count seems to be off #71

Open
gaborcsardi opened this issue Dec 30, 2023 · 1 comment
Open

Reference count seems to be off #71

gaborcsardi opened this issue Dec 30, 2023 · 1 comment
Labels
bug an unexpected problem or unintended behavior

Comments

@gaborcsardi
Copy link
Member

gaborcsardi commented Dec 30, 2023

x <- c(1,2,2.5)
.Internal(inspect(x))
#> @110f22ba8 14 REALSXP g0c3 [REF(1)] (len=3, tl=0) 1,2,2.5

lobstr::sxp(x)
#> [1:0x110f22ba8] <REALSXP[3]> (named:3)
@hadley
Copy link
Member

hadley commented Oct 21, 2024

I thought it might be because sxp() is creating a reference, but it seems like more than that:

x <- c(1,2,2.5)
.Internal(inspect(list(x)))
#> @104dee8d0 19 VECSXP g0c1 [] (len=1, tl=0)
#>   @1049ef548 14 REALSXP g0c3 [REF(3)] (len=3, tl=0) 1,2,2.5
lobstr::sxp(list(x))
#> [1:0x104867600] <VECSXP[1]> (named:2)
#>   [2:0x1049ef548] <REALSXP[3]> (named:4)

Created on 2024-10-21 with reprex v2.1.0

@hadley hadley added the bug an unexpected problem or unintended behavior label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

2 participants