Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
0cfa0fe2
Commit
0cfa0fe2
authored
Aug 31, 2011
by
Gustavo Niemeyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgo: note that CString result must be freed
R=golang-dev, bradfitz CC=golang-dev
https://golang.org/cl/4968054
parent
95429d82
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
doc.go
src/cmd/cgo/doc.go
+1
-1
util.c
src/pkg/runtime/cgo/util.c
+1
-1
No files found.
src/cmd/cgo/doc.go
View file @
0cfa0fe2
...
...
@@ -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
...
...
src/pkg/runtime/cgo/util.c
View file @
0cfa0fe2
...
...
@@ -18,7 +18,7 @@ x_cgo_malloc(void *p)
void
(
*
_cgo_malloc
)(
void
*
)
=
x_cgo_malloc
;
/* Stub for calling from Go */
/* Stub for calling fr
ee fr
om Go */
static
void
x_cgo_free
(
void
*
p
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment