ysbaddaden / gc

A garbage collector for Crystal
95 stars 6 forks source link

Roots for dynamic segments added with dload #25

Open beta-ziliani opened 2 years ago

beta-ziliani commented 2 years ago

Related #15 (for macOS)

dlopen adds various data/text segments that we need to add as roots. #24 fixes it for macOS, but a similar idea should be taken in place for other systems. See bdwgc/dyn_load.c for how to implement this in a variety of systems.

ysbaddaden commented 2 years ago

It means chasing references in library globals?

That's interesting, but that may be out of scope. For example we still wont know about library threads, so we can't scan their stack & CPU registers. If we expect all GC allocations to be referenced by the main program, then we don't need to scan the library segments & threads.