Skip to content

cmd/compile: empty struct takes space #12884

Closed
@minux

Description

@minux

Found while experimenting with https://golang.org/cl/15522.

Empty field (_ struct{}) takes space in Go 1.5, but not in Go 1.4
or any previous Go releases. See http://play.golang.org/p/OTr-GLz2UN.

$ go run OTr-GLz2UN.go # Go tip
16 24
16 16
12
$ go143 run OTr-GLz2UN.go
16 16
16 16
8

It's a compiler regression introduced by Go 1.5.

Tentatively labeled Go 1.5.2 as this can't be workaround.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions