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

Issue 5616072: code review 5616072: runtime: delete UpdateMemStats, replace with ReadMemSta... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 2 months ago by remyoudompheng
Modified:
13 years, 2 months ago
Reviewers:
CC:
bradfitzgoog, rsc, bradfitz, gustavo_niemeyer.net, golang-dev, remy_archlinux.org
Visibility:
Public.

Description

runtime: delete UpdateMemStats, replace with ReadMemStats(&stats). Unexports runtime.MemStats and rename MemStatsType to MemStats. The new accessor requires passing a pointer to a user-allocated MemStats structure. Fixes issue 2572.

Patch Set 1 #

Patch Set 2 : diff -r 7c35ab6ef473 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 7c35ab6ef473 https://go.googlecode.com/hg/ #

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

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

Total comments: 4

Patch Set 6 : diff -r a5952f39cd85 https://go.googlecode.com/hg/ #

Patch Set 7 : diff -r c4ce7d36d09e https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+129 lines, -105 lines) Patch
M src/cmd/godoc/godoc.go View 1 2 3 1 chunk +5 lines, -2 lines 0 comments Download
M src/pkg/encoding/gob/timing_test.go View 1 2 3 4 chunks +10 lines, -8 lines 0 comments Download
M src/pkg/expvar/expvar.go View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M src/pkg/fmt/fmt_test.go View 1 2 3 1 chunk +5 lines, -4 lines 0 comments Download
M src/pkg/net/rpc/server_test.go View 1 2 3 2 chunks +5 lines, -4 lines 0 comments Download
M src/pkg/reflect/all_test.go View 1 2 3 1 chunk +7 lines, -3 lines 0 comments Download
M src/pkg/runtime/gc_test.go View 1 2 3 1 chunk +6 lines, -5 lines 0 comments Download
M src/pkg/runtime/malloc.h View 1 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/mem.go View 1 2 3 4 5 3 chunks +8 lines, -13 lines 0 comments Download
M src/pkg/runtime/mgc0.c View 1 2 3 2 chunks +2 lines, -1 line 0 comments Download
M src/pkg/runtime/pprof/pprof.go View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M src/pkg/strconv/itoa_test.go View 1 2 3 1 chunk +5 lines, -4 lines 0 comments Download
M test/bench/garbage/parser.go View 1 2 3 4 8 chunks +10 lines, -10 lines 0 comments Download
M test/bench/garbage/stats.go View 1 2 3 4 1 chunk +2 lines, -1 line 0 comments Download
M test/bench/garbage/tree2.go View 1 2 3 4 3 chunks +8 lines, -7 lines 0 comments Download
M test/chan/select2.go View 1 2 3 1 chunk +6 lines, -3 lines 0 comments Download
M test/closure.go View 1 2 3 3 chunks +6 lines, -5 lines 0 comments Download
M test/gc2.go View 1 2 3 2 chunks +5 lines, -3 lines 0 comments Download
M test/init1.go View 1 2 3 3 chunks +7 lines, -7 lines 0 comments Download
M test/malloc1.go View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M test/mallocrand.go View 1 2 3 1 chunk +3 lines, -2 lines 0 comments Download
M test/mallocrep.go View 1 2 3 2 chunks +13 lines, -11 lines 0 comments Download
M test/mallocrep1.go View 1 2 3 4 chunks +7 lines, -7 lines 0 comments Download

Messages

Total messages: 18
remyoudompheng
Hello golang-dev@googlegroups.com (cc: golang-dev@googlegroups.com, remy@archlinux.org), I'd like you to review this change to https://go.googlecode.com/hg/
13 years, 2 months ago (2012-02-06 15:00:25 UTC) #1
bradfitzgoog
I like this. But now it highlights that weird type name. Could we s/MemStatsType/MemStats/ and ...
13 years, 2 months ago (2012-02-06 15:56:21 UTC) #2
rsc
type MemStats func ReadMemStats(m *MemStats) ?
13 years, 2 months ago (2012-02-06 16:25:30 UTC) #3
bradfitz
Works for me. On Mon, Feb 6, 2012 at 8:25 AM, <rsc@golang.org> wrote: > type ...
13 years, 2 months ago (2012-02-06 16:31:11 UTC) #4
gustavo_niemeyer.net
> type MemStats > > func ReadMemStats(m *MemStats) Get would be my suggested color. I've ...
13 years, 2 months ago (2012-02-06 16:32:36 UTC) #5
bradfitz
On Mon, Feb 6, 2012 at 8:32 AM, Gustavo Niemeyer <gustavo@niemeyer.net>wrote: > > type MemStats ...
13 years, 2 months ago (2012-02-06 16:33:53 UTC) #6
rsc
On Mon, Feb 6, 2012 at 11:32, Gustavo Niemeyer <gustavo@niemeyer.net> wrote: > Get would be ...
13 years, 2 months ago (2012-02-06 16:35:25 UTC) #7
gustavo_niemeyer.net
> I assumed Load (despite being a letter longer) was chosen because the > signature ...
13 years, 2 months ago (2012-02-06 16:36:06 UTC) #8
gustavo_niemeyer.net
> Sorry; Java poisoned the Get well. Agreed, that's a bad use case for it. ...
13 years, 2 months ago (2012-02-06 16:36:58 UTC) #9
remyoudompheng
Hello bradfitz@google.com, rsc@golang.org, bradfitz@golang.org, gustavo@niemeyer.net (cc: golang-dev@googlegroups.com, remy@archlinux.org), Please take another look.
13 years, 2 months ago (2012-02-06 17:16:08 UTC) #10
remyoudompheng
Hello bradfitz@google.com, rsc@golang.org, bradfitz@golang.org, gustavo@niemeyer.net (cc: golang-dev@googlegroups.com, remy@archlinux.org), Please take another look.
13 years, 2 months ago (2012-02-06 17:26:44 UTC) #11
remyoudompheng
On 2012/02/06 16:25:30, rsc wrote: > type MemStats > > func ReadMemStats(m *MemStats) > > ...
13 years, 2 months ago (2012-02-06 17:27:31 UTC) #12
bradfitz
http://codereview.appspot.com/5616072/diff/5/src/pkg/runtime/mem.go File src/pkg/runtime/mem.go (right): http://codereview.appspot.com/5616072/diff/5/src/pkg/runtime/mem.go#newcode11 src/pkg/runtime/mem.go:11: // Not locked during update; approximate. this comment is ...
13 years, 2 months ago (2012-02-06 17:31:07 UTC) #13
rsc
This is a definite improvement; thanks. http://codereview.appspot.com/5616072/diff/5/src/pkg/runtime/mem.go File src/pkg/runtime/mem.go (right): http://codereview.appspot.com/5616072/diff/5/src/pkg/runtime/mem.go#newcode11 src/pkg/runtime/mem.go:11: // Not locked ...
13 years, 2 months ago (2012-02-06 17:56:38 UTC) #14
remyoudompheng
Hello bradfitz@google.com, rsc@golang.org, bradfitz@golang.org, gustavo@niemeyer.net (cc: golang-dev@googlegroups.com, remy@archlinux.org), Please take another look.
13 years, 2 months ago (2012-02-06 17:59:36 UTC) #15
rsc
LGTM
13 years, 2 months ago (2012-02-06 18:00:59 UTC) #16
remyoudompheng
*** Submitted as http://code.google.com/p/go/source/detail?r=4696c572aaa6 *** runtime: delete UpdateMemStats, replace with ReadMemStats(&stats). Unexports runtime.MemStats and rename ...
13 years, 2 months ago (2012-02-06 18:16:39 UTC) #17
bradfitz
13 years, 2 months ago (2012-02-06 18:20:18 UTC) #18
On Mon, Feb 6, 2012 at 8:33 AM, Brad Fitzpatrick <bradfitz@golang.org>wrote:

>
>
> On Mon, Feb 6, 2012 at 8:32 AM, Gustavo Niemeyer <gustavo@niemeyer.net>wrote:
>
>> > type MemStats
>> >
>> > func ReadMemStats(m *MemStats)
>>
>> Get would be my suggested color. I've often used that pattern for
>> top-level functions because of the same conflict.
>
>
> I assumed Load (despite being a letter longer) was chosen because the
> signature is different, with an out parameter rather than returning.  I
> like that as a convention (Load*), even though it'll never really come up
> often in Go.
>

s/Load/Read/g.  I can't type and/or think, apparently.
Sign in to reply to this message.

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