4 ms·
> Can you build code that only touches memory with explicit malloc/free (or equivalent) calls? Yes you can. There is a package called 'unsafe' that lets you do
by kaib 16y ago
> Can you build code that only touches memory with explicit malloc/free (or equivalent) calls?
Yes you can. There is a package called 'unsafe' that lets you do pointer arithmetics and turn pointers into valid go types. It requires a bit of finesses, pointers from your own memory obviously wont be counted by the gc etc. Plus you need to make sure you only allocate with your own functions.
That said, the gc is getting along, it's hard to say when it hits a spot where you can use it for soft realtime applications. We just started doing high performance server coding in Go at Tinkercad and I used it while I still was at Google.