From: Gustavo Niemeyer Date: Wed, 31 Aug 2011 09:44:55 +0000 (-0300) Subject: cgo: note that CString result must be freed X-Git-Tag: weekly.2011-09-01~12 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=0cfa0fe2421accf8887a444fd76a6a1d0393796f;p=gostls13.git cgo: note that CString result must be freed R=golang-dev, bradfitz CC=golang-dev https://golang.org/cl/4968054 --- diff --git a/src/cmd/cgo/doc.go b/src/cmd/cgo/doc.go index 63413825af..cc608f40c2 100644 --- a/src/cmd/cgo/doc.go +++ b/src/cmd/cgo/doc.go @@ -72,7 +72,7 @@ the pointer to the first element explicitly: C.f(&x[0]). A few special functions convert between Go and C types by making copies of the data. In pseudo-Go definitions: - // Go string to C string + // Go string to C string - result is not garbage collected func C.CString(string) *C.char // C string to Go string diff --git a/src/pkg/runtime/cgo/util.c b/src/pkg/runtime/cgo/util.c index 9d96521f53..e06b6f64d9 100644 --- a/src/pkg/runtime/cgo/util.c +++ b/src/pkg/runtime/cgo/util.c @@ -18,7 +18,7 @@ x_cgo_malloc(void *p) void (*_cgo_malloc)(void*) = x_cgo_malloc; -/* Stub for calling from Go */ +/* Stub for calling free from Go */ static void x_cgo_free(void *p) {