Skip to content

cmd/compile: get rid of write barrier on slicing #71251

Closed
@randall77

Description

type S struct {
	a []byte
}

func f(s *S) {
	s.a = s.a[1:]
}

The write barrier in f seems unnecessary. We're always writing back to s.a a pointer to the same object that used to be there.
Noticed while looking at #71246.

Metadata

Assignees

No one assigned

    Labels

    ImplementationIssues describing a semantics-preserving change to the Go implementation.Performancecompiler/runtimeIssues related to the Go compiler and/or runtime.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions