You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was surprised to find out that Ptr{T} <: Ref{T}. I'm guessing that there's a reason for this, but it complicates a key conceptual aspect of Refs:
This type is guaranteed to point to valid, Julia-allocated memory of the correct type. The underlying data is protected from freeing by the garbage collector as long as the Ref itself is referenced.
Granted, the above statement remains true for anything constructed with Ref(...), but the problem remains that something which, under the type system, is a Ref{T}, could violate those guarantees by concretely being a Ptr{T} (as opposed to e.g. a Base.RefValue{T}).
The text was updated successfully, but these errors were encountered:
I was surprised to find out that
Ptr{T} <: Ref{T}
. I'm guessing that there's a reason for this, but it complicates a key conceptual aspect ofRef
s:Granted, the above statement remains true for anything constructed with
Ref(...)
, but the problem remains that something which, under the type system, is aRef{T}
, could violate those guarantees by concretely being aPtr{T}
(as opposed to e.g. aBase.RefValue{T}
).The text was updated successfully, but these errors were encountered: