From e8ecd9f67ad32008c973bba38b505d53373953e0 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 13 Feb 2014 14:31:48 -0500 Subject: [PATCH] runtime: update malloc comment for MSpan.needzero Missed this suggestion in CL 57680046. LGTM=iant R=iant CC=golang-codereviews https://golang.org/cl/63390043 --- src/pkg/runtime/malloc.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h index de82c551bd..aaa0693163 100644 --- a/src/pkg/runtime/malloc.h +++ b/src/pkg/runtime/malloc.h @@ -66,14 +66,14 @@ // // The small objects on the MCache and MCentral free lists // may or may not be zeroed. They are zeroed if and only if -// the second word of the object is zero. The spans in the -// page heap are always zeroed. When a span full of objects -// is returned to the page heap, the objects that need to be -// are zeroed first. There are two main benefits to delaying the +// the second word of the object is zero. A span in the +// page heap is zeroed unless s->needzero is set. When a span +// is allocated to break into small objects, it is zeroed if needed +// and s->needzero is set. There are two main benefits to delaying the // zeroing this way: // // 1. stack frames allocated from the small object lists -// can avoid zeroing altogether. +// or the page heap can avoid zeroing altogether. // 2. the cost of zeroing when reusing a small object is // charged to the mutator, not the garbage collector. // -- 2.48.1