summaryrefslogtreecommitdiff
path: root/misc/cgo/gmp/gmp.go
diff options
context:
space:
mode:
authorOndřej Surý <ondrej@sury.org>2011-06-03 11:31:24 +0200
committerOndřej Surý <ondrej@sury.org>2011-06-03 11:38:02 +0200
commit13f4fcd5bf09c70942b6c85a2b919ffa1ca0c6a8 (patch)
tree717e1ceeef3a60af29e7897c7629d1502b797838 /misc/cgo/gmp/gmp.go
parent6bf52070ef1028f7fcc98fad1e73795a7efd7ce7 (diff)
downloadgolang-13f4fcd5bf09c70942b6c85a2b919ffa1ca0c6a8.tar.gz
Imported Upstream version 2011.06.02
Diffstat (limited to 'misc/cgo/gmp/gmp.go')
-rw-r--r--misc/cgo/gmp/gmp.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/misc/cgo/gmp/gmp.go b/misc/cgo/gmp/gmp.go
index f7bbe9c51..7faa71b69 100644
--- a/misc/cgo/gmp/gmp.go
+++ b/misc/cgo/gmp/gmp.go
@@ -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
have pointers into the C world and to free those pointers when they
-are no longer needed. To help, the garbage collector calls an
-object's destroy() method prior to collecting it. C pointers can be
-wrapped by Go objects with appropriate destroy methods.
+are no longer needed. To help, the Go code can define Go objects
+holding the C pointers and use runtime.SetFinalizer on those Go objects.
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