Skip to content

cmd/compile: combine slice header and backing array for static slices into a single symbol #7637

@josharian

Description

@josharian
Static slices generate two symbols, one for the slice header and one for the backing
array. These could be combined into a single symbol, laid out with the slice header
followed by the backing array. This would reduce binary size, particularly for the
unicode tables.

This does not make sense to do unless issue #7599 is also done, otherwise the backing
array will be needlessly loaded during init.

See https://golang.org/cl/78870047/ for more discussion.

Something similar could probably profitably be done for strings and string headers,
although there is a different approach under discussion at issue #7384.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions