mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: don't clear ptrmask in fillptrmask
It is only ever called with a newly allocated slice.
This clearing code dates back to the C version of the compiler,
in which the function started like this:
static void
gengcmask(Type *t, uint8 gcmask[16])
{
...
memset(gcmask, 0, 16);
if(!haspointers(t))
return;
That memset was required for C, but not for Go.
Change-Id: I6fceb99b2dc8682685dca2e4289fcd58e2e5a0e0
Reviewed-on: https://go-review.googlesource.com/c/go/+/718340
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Keith Randall <khr@golang.org>
Auto-Submit: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Reviewed-by: Junyang Shao <shaojunyang@google.com>
This commit is contained in:
parent
66318d2b4b
commit
e0807ba470
1 changed files with 0 additions and 1 deletions
|
|
@ -1282,7 +1282,6 @@ func dgcptrmask(t *types.Type, write bool) *obj.LSym {
|
|||
// word offsets in t that hold pointers.
|
||||
// ptrmask is assumed to fit at least types.PtrDataSize(t)/PtrSize bits.
|
||||
func fillptrmask(t *types.Type, ptrmask []byte) {
|
||||
clear(ptrmask)
|
||||
if !t.HasPointers() {
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue