News for hackers. Stuff that matters.
Re:TinyGo: New Go Compiler Based on LLVM by learnfromstory on Thursday July 18, 2019 @08:13PM (#20475199)
Can you elaborate? How are pointers to floats problematic? Or is it something else?
Re:TinyGo: New Go Compiler Based on LLVM by viraptor on Thursday July 18, 2019 @08:19PM (#20475218)
Conservative GC is pretty much: look at all reachable memory, whatever looks like a pointer to a range which is allocated keeps that range allocated.

Pros: you don't have to care about type information and precise stack/structure walking.

Cons: If you have range 0x8000-0x8010 allocated, and have a variable with integer value 0x8001 somewhere in the memory, it will keep that range allocated. It doesn't matter that it's an int, not a pointer. Floats and 32-bit pointers have quite a lot of accidental collisions that way.

Re:TinyGo: New Go Compiler Based on LLVM by munificent on Thursday July 18, 2019 @08:15PM (#20475204)
Conservative GCs don't know which bytes in memory are actually pointers, so they treat every word in memory as being a pointer if it looks like one. This means if you have some other value that happens to look like a pointer — in this case a float — the GC will think it's pointing to some other memory and keep that memory around even though it isn't used.
Re:TinyGo: New Go Compiler Based on LLVM by pcwalton on Thursday July 18, 2019 @08:43PM (#20475342)
Because 1.0 is 0x3f800000, which is often right in the middle of the heap.