3 ms·
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
by Zariel 12y 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.
- twic 12y agoSo how can native code get access to objects on the Go heap?
- kasey_junk 12y agoWhich 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.