Hacker News new | ask | show | jobs
by Zariel 4437 days ago
The go runtime will manage memory of thins allocated in Go land but you must manage memory in C land.

If you allocate memory using C.malloc you must use C.free otherwise you will leak memory.

2 comments

Which again is very similar to JNI. I'm genuinely curious as to how Go's FFI differs from Java's to make that a distinguishing characteristic between the 2 languages.
So how can native code get access to objects on the Go heap?