counter
intValue
100
init.1
func()- OID
- 0658f0…f414:4
init.1 details
SetCounter
func(n int)SetCounter: non-crossing. Calling this cross-realm triggers the readonly check because it directly assigns a package var.
- OID
- 0658f0…f414:6
SetCounter details
SetCounterCrossing
func(n int)SetCounterCrossing: crossing version. This works correctly cross-realm because the caller enters this realm's context.
- OID
- 0658f0…f414:7
SetCounterCrossing details
GetCounter
func() int- OID
- 0658f0…f414:8
GetCounter details
DoubleCounter
func() intDoubleCounter reads counter and doubles it. Used to show that if counter were silently corrupted in memory, subsequent crossing calls would act on the wrong value.
- OID
- 0658f0…f414:9
DoubleCounter details
MutateBytes
func(bz []uint8)MutateBytes mutates the first byte of bz to 0xff. Used to test whether a foreign realm can write to caller-allocated bytes. Under storage=authority, bz has PkgID=caller; borrow rule #1 here makes m.Realm=crossrealm\_d (declaring realm); the write site (bz\[0] = ...) should fire readonly because bz.PkgID != m.Realm.ID.
- OID
- 0658f0…f414:10