runtime: introduce MSpan.needzero instead of writing to span data
This cleans up the code significantly, and it avoids any
possible problems with madvise zeroing out some but
not all of the data.
Fixes issue 6400.
On 2014/02/12 22:09:15, rsc wrote: > On Wed, Feb 12, 2014 at 4:57 PM, <mailto:iant@golang.org> ...
11 years, 4 months ago
(2014-02-13 07:09:35 UTC)
#7
On 2014/02/12 22:09:15, rsc wrote:
> On Wed, Feb 12, 2014 at 4:57 PM, <mailto:iant@golang.org> wrote:
>
> > LGTM
> >
> >
> > https://codereview.appspot.com/57680046/diff/90001/src/
> > pkg/runtime/malloc.h
> > File src/pkg/runtime/malloc.h (right):
> >
> > https://codereview.appspot.com/57680046/diff/90001/src/
> > pkg/runtime/malloc.h#newcode69
> > src/pkg/runtime/malloc.h:69: // the second word of the object is zero.
> > The spans in the
> > Please update comment.
> >
> > https://codereview.appspot.com/57680046/diff/90001/src/pkg/runtime/mgc0.c
> > File src/pkg/runtime/mgc0.c (right):
> >
> > https://codereview.appspot.com/57680046/diff/90001/src/
> > pkg/runtime/mgc0.c#newcode1301
> > src/pkg/runtime/mgc0.c:1301: runtime·printf("sweep %d %d\n",
> > s->sweepgen, sg);
> > Unrelated change?
> >
>
> It now appears that way; will remove, thanks. Waiting for Dmitriy to fix
> sweeping though.
I've sent sweeping fix.
runtime·free also requires s->needzero=1 before MHeap_Free call.
I would put s->needzero=1 in the beginning of MHeap_Free -- one less possibility
for bugs.
*** Submitted as https://code.google.com/p/go/source/detail?r=223d1c05e7c2 *** runtime: introduce MSpan.needzero instead of writing to span data This ...
11 years, 4 months ago
(2014-02-13 16:10:35 UTC)
#8
https://codereview.appspot.com/57680046/diff/90001/src/pkg/runtime/malloc.h File src/pkg/runtime/malloc.h (right): https://codereview.appspot.com/57680046/diff/90001/src/pkg/runtime/malloc.h#newcode69 src/pkg/runtime/malloc.h:69: // the second word of the object is zero. ...
11 years, 4 months ago
(2014-02-13 18:32:15 UTC)
#11
Issue 57680046: code review 57680046: runtime: introduce MSpan.needzero instead of writing to...
(Closed)
Created 11 years, 4 months ago by rsc
Modified 11 years, 4 months ago
Reviewers: iant, gobot
Base URL:
Comments: 2