Open s3rj1k opened 1 year ago
It's needed because package core/intern
requires some uintptr
hacks to replicate weak references, which was needed to prevent certain memory leaks from occuring. This assumes that the GC doesn't move pointers around when they're on the heap, which the package acts as a safe guard for.
If something like https://github.com/golang/go/issues/46787 gets added, we can probably get rid of assume-no-moving-gc
altogether.
(As a side note, I'm not too confident that core/intern
is doing its intended job right now. I'll have to look into it, but I think there was a regression that caused it to leak memory again. It's hard to figure this out when building the code after the slightest changes takes 20 minutes.)
Thanks for explaining, a bit hesitated to use the binding with that dependency
It's pretty much safe to close this issue, I would ask for a tagged release when gtk4 binding removes that unsafe dependency.
Thanks for your effort.
@diamondburned Go 1.21 was released today and it has a new type runtime.Pinner
for this purpose. Maybe worth taking a look?
Just out of curiosity why go4.org/unsafe/assume-no-moving-gc is needed and can it be removed at some point?