Commit 0cfa0fe2 authored by Gustavo Niemeyer's avatar Gustavo Niemeyer

cgo: note that CString result must be freed

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/4968054
parent 95429d82
...@@ -72,7 +72,7 @@ the pointer to the first element explicitly: C.f(&x[0]). ...@@ -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 A few special functions convert between Go and C types
by making copies of the data. In pseudo-Go definitions: 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 func C.CString(string) *C.char
// C string to Go string // C string to Go string
......
...@@ -18,7 +18,7 @@ x_cgo_malloc(void *p) ...@@ -18,7 +18,7 @@ x_cgo_malloc(void *p)
void (*_cgo_malloc)(void*) = x_cgo_malloc; void (*_cgo_malloc)(void*) = x_cgo_malloc;
/* Stub for calling from Go */ /* Stub for calling free from Go */
static void static void
x_cgo_free(void *p) x_cgo_free(void *p)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment