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

Issue 6558046: code review 6558046: pkg/go/ast: Avoid doing zero-length writes to the fd. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 7 months ago by akumar
Modified:
11 years, 7 months ago
Reviewers:
bradfitz
CC:
rsc, rminnich, dave_cheney.net, r, golang-dev
Visibility:
Public.

Description

pkg/go/ast: Avoid doing zero-length writes to the fd. After each line, ast.Print would do a zero-length write, which would hit the boundary condition on Plan 9 when reading over pipes (since message boundaries are preserved). This change makes sure we only do positive- length writes.

Patch Set 1 #

Patch Set 2 : diff -r 90c9121e26c3 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 90c9121e26c3 https://go.googlecode.com/hg/ #

Total comments: 4

Patch Set 4 : diff -r 90c9121e26c3 https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r 90c9121e26c3 https://go.googlecode.com/hg/ #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -2 lines) Patch
M src/pkg/go/ast/print.go View 1 2 3 4 1 chunk +4 lines, -2 lines 1 comment Download

Messages

Total messages: 11
akumar
Hello rsc@golang.org, rminnich@gmail.com (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
11 years, 7 months ago (2012-09-23 21:47:50 UTC) #1
dave_cheney.net
This CL sounds reasonable, but wouldn't output be buffered by something that is coalescing writes? ...
11 years, 7 months ago (2012-09-23 21:50:30 UTC) #2
r
http://codereview.appspot.com/6558046/diff/4001/src/pkg/go/ast/print.go File src/pkg/go/ast/print.go (right): http://codereview.appspot.com/6558046/diff/4001/src/pkg/go/ast/print.go#newcode112 src/pkg/go/ast/print.go:112: if len(data)-n > 0 { if len(data) > n
11 years, 7 months ago (2012-09-23 21:56:01 UTC) #3
r
http://codereview.appspot.com/6558046/diff/4001/src/pkg/go/ast/print.go File src/pkg/go/ast/print.go (right): http://codereview.appspot.com/6558046/diff/4001/src/pkg/go/ast/print.go#newcode111 src/pkg/go/ast/print.go:111: // Avoid doing zero-length writes. delete this comment. it's ...
11 years, 7 months ago (2012-09-23 21:57:34 UTC) #4
akumar
PTAL. http://codereview.appspot.com/6558046/diff/4001/src/pkg/go/ast/print.go File src/pkg/go/ast/print.go (right): http://codereview.appspot.com/6558046/diff/4001/src/pkg/go/ast/print.go#newcode111 src/pkg/go/ast/print.go:111: // Avoid doing zero-length writes. On 2012/09/23 21:57:34, ...
11 years, 7 months ago (2012-09-23 22:00:41 UTC) #5
r
http://codereview.appspot.com/6558046/diff/9001/src/pkg/go/ast/print.go File src/pkg/go/ast/print.go (right): http://codereview.appspot.com/6558046/diff/9001/src/pkg/go/ast/print.go#newcode111 src/pkg/go/ast/print.go:111: if len(data) > n { it would be simpler ...
11 years, 7 months ago (2012-09-23 22:02:58 UTC) #6
akumar
On 2012/09/23 22:02:58, r wrote: > http://codereview.appspot.com/6558046/diff/9001/src/pkg/go/ast/print.go > File src/pkg/go/ast/print.go (right): > > http://codereview.appspot.com/6558046/diff/9001/src/pkg/go/ast/print.go#newcode111 > ...
11 years, 7 months ago (2012-09-23 22:21:46 UTC) #7
r
LGTM
11 years, 7 months ago (2012-09-23 22:27:19 UTC) #8
r
*** Submitted as http://code.google.com/p/go/source/detail?r=6fdbfbfa8813 *** pkg/go/ast: Avoid doing zero-length writes to the fd. After each ...
11 years, 7 months ago (2012-09-23 22:30:54 UTC) #9
bradfitz
I assume you'll also fix the plan9 pkg os code to just work with 0-length ...
11 years, 7 months ago (2012-09-23 22:58:38 UTC) #10
rsc
11 years, 7 months ago (2012-09-24 03:13:35 UTC) #11
On Sun, Sep 23, 2012 at 6:58 PM, Brad Fitzpatrick <bradfitz@golang.org> wrote:
> I assume you'll also fix the plan9 pkg os code to just work with 0-length
> writes? That seems like the real problem.

Trust me, you don't want to start this discussion.

Russ
Sign in to reply to this message.

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