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
For simple/most VMs, ObjectReference == Address so the object.to_address::<VM>() function call is unnecessary in ObjectReference methods. Indeed I have found cases where we don't have a VM type parameter but want to print the liveness of an object for debugging. Smuggling the VM type parameter into such places may require changing many places or just be impossible because nothing in the call stack above has a VM type parameter.
I think we should provide alternative methods in ObjectReference that remove the use of to_address::<VM>() in favour of directly using Address(self.0.get()) where self is an ObjectReference.
We can add debug asserts to these functions which assert that the object reference and address are indeed the same to prevent developers from misusing this API.
The text was updated successfully, but these errors were encountered:
ObjectReference::to_address was removed in #1195. Now ObjectReference::to_raw_address does not require a VM type parameter. I believe this issue can be closed.
For simple/most VMs,
ObjectReference == Address
so theobject.to_address::<VM>()
function call is unnecessary inObjectReference
methods. Indeed I have found cases where we don't have aVM
type parameter but want to print the liveness of an object for debugging. Smuggling theVM
type parameter into such places may require changing many places or just be impossible because nothing in the call stack above has aVM
type parameter.I think we should provide alternative methods in
ObjectReference
that remove the use ofto_address::<VM>()
in favour of directly usingAddress(self.0.get())
whereself
is anObjectReference
.We can add debug asserts to these functions which assert that the object reference and address are indeed the same to prevent developers from misusing this API.
The text was updated successfully, but these errors were encountered: