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
Can you document the differences between the types Rooted and Handle?
They seem to be very similar. Maybe, also some examples of the 2 different usecases they satisfy.
I have a stack VM and when i allocate a new object, i do insert on the heap and it gives back a Rooted<T>.
But on the example, you are using Handle in the Object enum. Should i do rooted.into_handle()?
It is unclear.
It looks like, the Handle will not keep the object alive.
The text was updated successfully, but these errors were encountered:
Yes, you're correct. Rooted will survive a heap clean (and acts as the 'root' of an object tree) whereas Handle will not. If you have a stack VM, items on your stack should probably be Rooted<Value>s, but references within your Value should be Handle<Value>s.
Yes, you're correct. Rooted will survive a heap clean (and acts as the 'root' of an object tree) whereas Handle will not. If you have a stack VM, items on your stack should probably be Rooted<Value>s, but references within your Value should be Handle<Value>s.
Right. Rooted is like Rc<T> and Handle is like Weak<T>
Can you document the differences between the types
Rooted
andHandle
?They seem to be very similar. Maybe, also some examples of the 2 different usecases they satisfy.
I have a stack VM and when i allocate a new object, i do
insert
on the heap and it gives back aRooted<T>
.But on the example, you are using
Handle
in theObject
enum. Should i dorooted.into_handle()
?It is unclear.
It looks like, the
Handle
will not keep the object alive.The text was updated successfully, but these errors were encountered: