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

Issue 116390043: code review 116390043: runtime: get rid of free (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
9 years, 9 months ago by dvyukov
Modified:
9 years, 9 months ago
Reviewers:
gobot, khr
CC:
golang-codereviews, josharian, btracey, khr, bradfitz, r, rlh, rsc
Visibility:
Public.

Description

runtime: get rid of free Several reasons: 1. Significantly simplifies runtime. 2. This code proved to be buggy. 3. Free is incompatible with bump-the-pointer allocation. 4. We want to write runtime in Go, Go does not have free. 5. Too much code to free env strings on startup.

Patch Set 1 #

Patch Set 2 : diff -r 3dcf291a83a2 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 3 : diff -r 3dcf291a83a2 https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 1

Patch Set 4 : diff -r 6125ea2b1dbf https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 5 : diff -r 6125ea2b1dbf https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 6 : diff -r 6ced5a748d5e https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 1

Patch Set 7 : diff -r 14d03dafb196 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 8 : diff -r 14d03dafb196 https://dvyukov%40google.com@code.google.com/p/go/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -325 lines) Patch
M src/pkg/runtime/env_posix.c View 1 chunk +2 lines, -13 lines 0 comments Download
M src/pkg/runtime/malloc.h View 6 chunks +0 lines, -8 lines 0 comments Download
M src/pkg/runtime/malloc.c View 2 chunks +0 lines, -97 lines 0 comments Download
M src/pkg/runtime/mcache.c View 4 chunks +0 lines, -37 lines 0 comments Download
M src/pkg/runtime/mcentral.c View 7 chunks +0 lines, -80 lines 0 comments Download
M src/pkg/runtime/mgc0.c View 6 chunks +14 lines, -47 lines 0 comments Download
M src/pkg/runtime/mheap.c View 2 chunks +0 lines, -36 lines 0 comments Download
M src/pkg/runtime/panic.c View 1 chunk +1 line, -2 lines 0 comments Download
M src/pkg/runtime/proc.c View 1 chunk +1 line, -3 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 chunk +0 lines, -1 line 0 comments Download
M src/pkg/runtime/time.goc View 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 10
dvyukov
Hello golang-codereviews@googlegroups.com (cc: bradfitz@golang.org, khr@golang.org, r@golang.org, rlh@golang.org, rsc@golang.org), I'd like you to review this change ...
9 years, 9 months ago (2014-07-29 11:17:39 UTC) #1
josharian
https://codereview.appspot.com/116390043/diff/20002/src/pkg/runtime/env_posix.c File src/pkg/runtime/env_posix.c (right): https://codereview.appspot.com/116390043/diff/20002/src/pkg/runtime/env_posix.c#newcode55 src/pkg/runtime/env_posix.c:55: // so that they are not allocated using tiny ...
9 years, 9 months ago (2014-07-29 13:32:55 UTC) #2
dvyukov
On 2014/07/29 13:32:55, josharian wrote: > https://codereview.appspot.com/116390043/diff/20002/src/pkg/runtime/env_posix.c > File src/pkg/runtime/env_posix.c (right): > > https://codereview.appspot.com/116390043/diff/20002/src/pkg/runtime/env_posix.c#newcode55 > ...
9 years, 9 months ago (2014-07-29 13:37:34 UTC) #3
dvyukov
On 2014/07/29 13:37:34, dvyukov wrote: > On 2014/07/29 13:32:55, josharian wrote: > > > https://codereview.appspot.com/116390043/diff/20002/src/pkg/runtime/env_posix.c ...
9 years, 9 months ago (2014-07-29 18:09:48 UTC) #4
btracey
The new malloc.go has the comment: "// If the block will be freed with runtime·free(), ...
9 years, 9 months ago (2014-07-30 16:15:01 UTC) #5
khr
LGTM. https://codereview.appspot.com/116390043/diff/80001/src/pkg/runtime/mcentral.c File src/pkg/runtime/mcentral.c (left): https://codereview.appspot.com/116390043/diff/80001/src/pkg/runtime/mcentral.c#oldcode209 src/pkg/runtime/mcentral.c:209: if(s->incache) It would be nice to have some ...
9 years, 9 months ago (2014-07-30 23:41:07 UTC) #6
dvyukov
On 2014/07/30 23:41:07, khr wrote: > LGTM. > > https://codereview.appspot.com/116390043/diff/80001/src/pkg/runtime/mcentral.c > File src/pkg/runtime/mcentral.c (left): > ...
9 years, 9 months ago (2014-07-31 08:54:48 UTC) #7
dvyukov
*** Submitted as https://code.google.com/p/go/source/detail?r=6acc2dd545b2 *** runtime: get rid of free Several reasons: 1. Significantly simplifies ...
9 years, 9 months ago (2014-07-31 08:55:45 UTC) #8
gobot
This CL appears to have broken the windows-386 builder. See http://build.golang.org/log/c29ea5b3878dc72397fd51b5e77c41c37b90b3aa
9 years, 9 months ago (2014-07-31 09:15:06 UTC) #9
dvyukov
9 years, 9 months ago (2014-07-31 12:16:10 UTC) #10
mailed https://codereview.appspot.com/120400043
it become outdated when we've removed settype caching
thanks

On Wed, Jul 30, 2014 at 8:14 PM,  <tracey.brendan@gmail.com> wrote:
> The new malloc.go has the comment: "// If the block will be freed with
runtime·free(), typ must be nil.". It seems that something will need to change
(if only the comment) once free goes away.
Sign in to reply to this message.

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