News for hackers. Stuff that matters.
Re:Why Discord is switching from Go to Rust by marrs on Tuesday February 04, 2020 @02:26PM (#22239862)
How does Go allow you to manage memory manually? Malloc/free or something more sophisticated?
Re:Why Discord is switching from Go to Rust by masklinn on Tuesday February 04, 2020 @03:18PM (#22240460)
It doesn't. If you disable the GC… you only have an allocator, the only "free" is to run the entire GC by hand (calling runtime.GC())
Re:Why Discord is switching from Go to Rust by lostcolony on Tuesday February 04, 2020 @06:46PM (#22242428)
So other comments didn't mention this, per se, but Go gives you tools to see what memory escapes the stack and ends up being heap allocated. If you work to ensure things stay stack allocated, it gets freed when the stack frees, and the GC never touches it.

But, per other comments, there isn't any direct malloc/free behavior. It just provides tools to help you enable the compiler to determine that GC is not needed for some.

Re:Why Discord is switching from Go to Rust by tsimionescu on Tuesday February 04, 2020 @03:30PM (#22240590)
It doesn't. You could start and stop the GC occasionally, maybe?