summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Niemeyer <gustavo@niemeyer.net>2011-08-31 06:44:55 -0300
committerGustavo Niemeyer <gustavo@niemeyer.net>2011-08-31 06:44:55 -0300
commit8af2d6ae104831e706c4770bd62cc9ab87511082 (patch)
treea8d454c7175141da96560f22bdd5bcbef0a770e6
parent703c7b4e98fb9b0c99c586e5678d7c9e0b74a85f (diff)
downloadgo-8af2d6ae104831e706c4770bd62cc9ab87511082.tar.gz
cgo: note that CString result must be freed
R=golang-dev, bradfitz CC=golang-dev http://codereview.appspot.com/4968054
-rw-r--r--src/cmd/cgo/doc.go2
-rw-r--r--src/pkg/runtime/cgo/util.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/cmd/cgo/doc.go b/src/cmd/cgo/doc.go
index 63413825a..cc608f40c 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 9d96521f5..e06b6f64d 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)
{