]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: update malloc comment for MSpan.needzero
authorRuss Cox <rsc@golang.org>
Thu, 13 Feb 2014 19:31:48 +0000 (14:31 -0500)
committerRuss Cox <rsc@golang.org>
Thu, 13 Feb 2014 19:31:48 +0000 (14:31 -0500)
Missed this suggestion in CL 57680046.

LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/63390043

src/pkg/runtime/malloc.h

index de82c551bd311c72d1f4167de3c1020d6d1392c1..aaa0693163d2c61a78c895210c6f50fa2d8f2fe0 100644 (file)
 //
 // 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.
 //