]> Cypherpunks repositories - gostls13.git/commitdiff
cgo: note that CString result must be freed
authorGustavo Niemeyer <gustavo@niemeyer.net>
Wed, 31 Aug 2011 09:44:55 +0000 (06:44 -0300)
committerGustavo Niemeyer <gustavo@niemeyer.net>
Wed, 31 Aug 2011 09:44:55 +0000 (06:44 -0300)
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4968054

src/cmd/cgo/doc.go
src/pkg/runtime/cgo/util.c

index 63413825af59dfae9ddf3b907fccce9f4f4c01fc..cc608f40c26c43c18ec1d4847757bcc29ca46ba9 100644 (file)
@@ -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
index 9d96521f53ffceaa42af0503e1e1bcb4fc8b7357..e06b6f64d99314b44de4ce42eec3b6b87c25c2d1 100644 (file)
@@ -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)
 {