on-internet
← Community

Can I build an environment object from a memory address?

Stack Overflow ·

I found that we can build/reconstruct an external pointer from a memory address, see this example where I take a pointer from a data table object and rebuild it: # devtools::install_github("randy3k/xptr") iris_dt <- data.table::as.data.table(iris) ptr1 <- attr(iris_dt, ".internal.selfref") ptr1 #> <pointer: 0x13c00d4e0> typeof(ptr1) #> [1] "externalptr" address <- xptr::xptr_address(ptr1) address #> [1] "0x13c00d4e0" ptr2 <- xptr::new_xptr(address) identical(ptr1, ptr2) #> [1] TRUE Obviously xptr::new_xptr("0x13c00d4e0") is not stable between sessions, I am aware that the above is not allocati

Comments

Sign in or sign up to comment and upvote.

No comments yet.