mirror of
https://github.com/golang/go
synced 2024-11-21 19:54:41 -07:00
misc/cgo: remove reference to 'destroy' function
R=golang-dev, gri CC=golang-dev https://golang.org/cl/4558042
This commit is contained in:
parent
2261021be1
commit
6216307e25
@ -86,9 +86,8 @@ explicitly in Go to pointers to arrays, as they do (implicitly) in C.
|
|||||||
|
|
||||||
Garbage collection is the big problem. It is fine for the Go world to
|
Garbage collection is the big problem. It is fine for the Go world to
|
||||||
have pointers into the C world and to free those pointers when they
|
have pointers into the C world and to free those pointers when they
|
||||||
are no longer needed. To help, the garbage collector calls an
|
are no longer needed. To help, the Go code can define Go objects
|
||||||
object's destroy() method prior to collecting it. C pointers can be
|
holding the C pointers and use runtime.SetFinalizer on those Go objects.
|
||||||
wrapped by Go objects with appropriate destroy methods.
|
|
||||||
|
|
||||||
It is much more difficult for the C world to have pointers into the Go
|
It is much more difficult for the C world to have pointers into the Go
|
||||||
world, because the Go garbage collector is unaware of the memory
|
world, because the Go garbage collector is unaware of the memory
|
||||||
|
Loading…
Reference in New Issue
Block a user