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
Strangely, the relocate method comes in two different versions.
The first version is used to move an object in memory, like this:
(relocate proc (- size))
which moves it back size bytes in memory. This takes two arguments (this _type_), and (offset int). This method is defined for object in gkernel, and many others in relocate.gc.
The second version is used by the linker when it finishes linking a v2/v4 object. This takes three arguments: (this _type), (heap kheap), and (name (pointer uint8)) (a C string).
We need an option to "override" a method definition in a type tree. This is an unsafe thing to do in general and relies on the programmer being careful on what they call relocate on - doing it on an object is a dangerous thing to do.
The text was updated successfully, but these errors were encountered:
All GOAL objects have 9 methods:
Strangely, the
relocate
method comes in two different versions.The first version is used to move an object in memory, like this:
which moves it back
size
bytes in memory. This takes two arguments(this _type_)
, and(offset int)
. This method is defined forobject
ingkernel
, and many others inrelocate.gc
.The second version is used by the linker when it finishes linking a v2/v4 object. This takes three arguments:
(this _type)
,(heap kheap)
, and(name (pointer uint8))
(a C string).We need an option to "override" a method definition in a type tree. This is an unsafe thing to do in general and relies on the programmer being careful on what they call
relocate
on - doing it on anobject
is a dangerous thing to do.The text was updated successfully, but these errors were encountered: