orangeduck / tgc

A Tiny Garbage Collector for C
Other
968 stars 64 forks source link

Infinite loop in tgc_mark_stack #19

Closed ssuukk closed 4 years ago

ssuukk commented 4 years ago

Hi,

I tried to adapt tgc for compilation under cc65. This C compiler doesn't support floats, so all I really did was "convert" all ops involving floats to properly scaled divisions or numbers - this part shouldn't be a problem (I guess...)

The problem is that inside the first tgc_alloc the control reaches tgc_mark_stack, where it is stuck inside this loop forever:

if (bot < top) { for (p = top; p >= bot; p = ((char)p) - sizeof(void)) { tgc_mark_ptr(gc, *((void**)p)); } }

Could it be due to 8-bit architecture of the platform or rather anything I've messed up?

orangeduck commented 4 years ago

Yeah it sounds like probably this architecture is too irregular to use this garbage collector... sorry.