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

Issue 13345048: code review 13345048: cmd/cgo: allow C.malloc(0) always (Closed)

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

Description

cmd/cgo: allow C.malloc(0) always Because we can, and because it otherwise might crash the program if we think we're out of memory. Fixes issue 6390.

Patch Set 1 #

Patch Set 2 : diff -r 589bcd9dd528 https://code.google.com/p/go/ #

Total comments: 1

Patch Set 3 : diff -r a6fc26ebfd61 https://code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -0 lines) Patch
M misc/cgo/test/cgo_test.go View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/cmd/cgo/out.go View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/runtime/cgo/gcc_util.c View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 5
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://code.google.com/p/go/
11 years, 6 months ago (2013-09-16 15:13:22 UTC) #1
iant
LGTM
11 years, 6 months ago (2013-09-16 15:25:53 UTC) #2
minux1
https://codereview.appspot.com/13345048/diff/2001/src/cmd/cgo/out.go File src/cmd/cgo/out.go (right): https://codereview.appspot.com/13345048/diff/2001/src/cmd/cgo/out.go#newcode1229 src/cmd/cgo/out.go:1229: p = malloc(1); i wonder why translate malloc(0) to ...
11 years, 6 months ago (2013-09-16 15:26:52 UTC) #3
rsc
> https://codereview.appspot.com/13345048/diff/2001/src/cmd/cgo/out.go#newcode1229 > src/cmd/cgo/out.go:1229: p = malloc(1); > i wonder why translate malloc(0) to malloc(1)? ...
11 years, 6 months ago (2013-09-16 17:46:24 UTC) #4
rsc
11 years, 6 months ago (2013-09-16 18:04:58 UTC) #5
*** Submitted as https://code.google.com/p/go/source/detail?r=c2779374f662 ***

cmd/cgo: allow C.malloc(0) always

Because we can, and because it otherwise might crash
the program if we think we're out of memory.

Fixes issue 6390.

R=golang-dev, iant, minux.ma
CC=golang-dev
https://codereview.appspot.com/13345048
Sign in to reply to this message.

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