Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(534)

Issue 1399041: code review 1399041: Correct _cgo_free when C ABI does not pass first arg on... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 9 months ago by iant
Modified:
14 years, 9 months ago
Reviewers:
CC:
rsc, golang-dev
Visibility:
Public.

Description

Correct _cgo_free when C ABI does not pass first arg on stack. It turns out that _cgo_malloc is used, via cmalloc in runtime/cgocall.c, which is called by code generated by out.go for the ·_C_CString function. I can't find a call to _cgo_free, but given _cgo_malloc we might as well keep _cgo_free. This patch fixes it so that it should work on amd64.

Patch Set 1 #

Patch Set 2 : code review 1399041: Correct _cgo_free when C ABI does not pass first arg on... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -2 lines) Patch
M src/cmd/cgo/out.go View 1 1 chunk +1 line, -1 line 0 comments Download
M src/libcgo/util.c View 2 chunks +12 lines, -1 line 0 comments Download

Messages

Total messages: 3
iant
Hello rsc (cc: golang-dev@googlegroups.com), I'd like you to review this change.
14 years, 9 months ago (2010-05-29 00:52:12 UTC) #1
rsc
LGTM
14 years, 9 months ago (2010-05-29 05:21:49 UTC) #2
iant
14 years, 9 months ago (2010-05-31 05:23:01 UTC) #3
*** Submitted as http://code.google.com/p/go/source/detail?r=f36cff25e9c8 ***

Correct _cgo_free when C ABI does not pass first arg on stack.

It turns out that _cgo_malloc is used, via cmalloc in
runtime/cgocall.c, which is called by code generated by out.go
for the ·_C_CString function.  I can't find a call to
_cgo_free, but given _cgo_malloc we might as well keep
_cgo_free.  This patch fixes it so that it should work on
amd64.

R=rsc
CC=golang-dev
http://codereview.appspot.com/1399041
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b