toit icon indicating copy to clipboard operation
toit copied to clipboard

Investigate whether we can merge PointerCallback and RootCallback

Open floitsch opened this issue 3 years ago • 1 comments

Feels like the PointerCallback is just "better" than RootCallback. It supports visiting C-pointers as well. For Heapobjects they already behave almost identical (with the exception of ByteArrays which can have a C-pointer).

Also investigate whether we can use the Curiously recurring template pattern to get rid of the virtual calls.

Probably makes sense to devirtualize do.roots at the same time (using a curiously recurring template pattern).

floitsch avatar Jan 14 '22 10:01 floitsch

Now PointerCallback is only for snapshots, and RootCallback is only for GC. As such it makes sense to keep them separate, and perhaps they will get better names at some point. I think PointerCallback is compiled out on embedded where it is not needed.

erikcorry avatar Mar 18 '22 13:03 erikcorry