Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/types: add GCSizes #17586

Open
josharian opened this issue Oct 25, 2016 · 6 comments

Comments

Projects
None yet
5 participants
@josharian
Copy link
Contributor

commented Oct 25, 2016

Provide a GCSizes that matches cmd/compile exactly and that all clients that depend on the same size computations as cmd/compile can use.

See #17584 for context.

@mdempsky

This comment has been minimized.

Copy link
Member

commented Oct 25, 2016

What's the advantage of providing a separate GCSizes implementation, rather than just making StdSizes exactly match cmd/compile?

@griesemer

This comment has been minimized.

Copy link
Contributor

commented Oct 25, 2016

@mdempsky That's an ok choice too, but I like to keep a version around that shows that there's no need to waste space in internal fragmentation (which is currently the case for gc-aligned structs used inside arrays or other structs).

@josharian

This comment has been minimized.

Copy link
Contributor Author

commented Feb 13, 2017

If/when we look at this, we should make sure that GCSizes knows to add a padding byte at the end if the final struct field has size zero.

@gopherbot

This comment has been minimized.

Copy link

commented Mar 2, 2017

CL https://golang.org/cl/37666 mentions this issue.

gopherbot pushed a commit that referenced this issue Mar 2, 2017

go/types: add a compiler param to SizesFor
The current StdSizes most closely matches
the gc compiler, and the uses I know of that care
which compiler the sizes are for are all for
the gc compiler, so call the existing
implementation "gc".

Updates #17586
Fixes #19351

Change-Id: I2bdd694518fbe233473896321a1f9758b46ed79b
Reviewed-on: https://go-review.googlesource.com/37666
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
@bradfitz

This comment has been minimized.

Copy link
Member

commented May 24, 2017

Looks like this happened? What remains, @josharian?

@josharian

This comment has been minimized.

Copy link
Contributor Author

commented May 24, 2017

Kind of. We now have a SizesFor that supports returning different concrete Sizes implementations, but we don't exactly have a concrete implementation for cmd/compile--it's close, but not exact, e.g. the padding byte in some circumstances. Moving to unplanned, though, pending direct need for it.

@josharian josharian modified the milestones: Unplanned, Go1.9 May 24, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.