assemblyscript icon indicating copy to clipboard operation
assemblyscript copied to clipboard

Can the `cookie` parameter of `__visit` be removed?

Open ApsarasX opened this issue 3 years ago • 0 comments

I'm reimplementing the incremental runtime of AssemblyScript in C.

And I found that some visiting functions(__visit visitRoots visitStack) of GC all have cookie parameters, but they are only passed without using it.

So what is the function of cookie parameter?

Can I remove it?

截屏2022-08-05 15 39 02

ApsarasX avatar Aug 05 '22 07:08 ApsarasX

The cookie parameter has remained from previous implementations, where multiple operations during visiting were possible (increment / decrement reference count). Hasn't been removed in anticipation of potential future cases where, besides marking, other operations could be useful. Probably doesn't matter much once Wasm GC becomes a thing.

dcodeIO avatar Sep 05 '22 06:09 dcodeIO