diff options
author | Jerrin Shaji George <jerrinsg@gmail.com> | 2020-02-05 01:21:11 +0000 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2020-02-05 21:19:43 +0000 |
commit | 921ceadd2997f2c0267455e13f909df044234805 (patch) | |
tree | fe36f452a5b3752931109c17584b4c7eabdb77d9 /src/runtime/malloc.go | |
parent | 88ae4ccefb60ce7e83b25c3bf0f55a4d8704e123 (diff) | |
download | go-921ceadd2997f2c0267455e13f909df044234805.tar.gz go-921ceadd2997f2c0267455e13f909df044234805.zip |
runtime: rewrite a comment in malloc.go
This commit changes the wording of a comment in malloc.go that describes
how span objects are zeroed to make it more clear.
Change-Id: I07722df1e101af3cbf8680ad07437d4a230b0168
GitHub-Last-Rev: 0e909898c709a9119cea7dbd80c25d9d7a73e22b
GitHub-Pull-Request: golang/go#37008
Reviewed-on: https://go-review.googlesource.com/c/go/+/217618
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/malloc.go')
-rw-r--r-- | src/runtime/malloc.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go index de363408e7..5f92e7480e 100644 --- a/src/runtime/malloc.go +++ b/src/runtime/malloc.go @@ -62,9 +62,10 @@ // Allocating and freeing a large object uses the mheap // directly, bypassing the mcache and mcentral. // -// Free object slots in an mspan are zeroed only if mspan.needzero is -// false. If needzero is true, objects are zeroed as they are -// allocated. There are various benefits to delaying zeroing this way: +// If mspan.needzero is false, then free object slots in the mspan are +// already zeroed. Otherwise if needzero is true, objects are zeroed as +// they are allocated. There are various benefits to delaying zeroing +// this way: // // 1. Stack frame allocation can avoid zeroing altogether. // |