by craftamap · 3y ago · 0 comments
Can you explain some more?
Seemed to me that it did?
Example given in the link.
https://gist.github.com/kripken/5cd3e18b6de41c559d590e44252e...
Or is it that the GC ignores interior pointers during mark and sweep?
Then once Java introduces value types, wouldn't the language encounter the same problem for composite types?
Would be a weird choice to not handle interior pointers.
I'm a bit out-of-my-depth here, just wondering.
In Go you can have a fixed-size array of structs, where each struct contains many fields, including a fixed-size array field. The whole thing can be allocated at once and is automatically zeroed out. And then you can take a pointer to any struct’s field or any internal array element.
“Interior” means the interior of a single object. A pointer to anywhere within an object prevents it from being collected.
Depending on how much code you want to run it may be interesting to be able to decide between shipping a GC implementation and slowing down your code to avoid it. If it is an extra 50% code size on top of a fairly small amount of first-party code you may pick WasmGC.