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

Closed
josharian opened this issue Oct 25, 2016 · 7 comments
Closed

go/types: add GCSizes #17586

josharian opened this issue Oct 25, 2016 · 7 comments
Milestone

Comments

@josharian
Copy link
Contributor

josharian 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
Copy link
Member

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

@griesemer
Copy link
Contributor

@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
Copy link
Contributor Author

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
Copy link

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

gopherbot pushed a commit that referenced this issue Mar 2, 2017
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
Copy link
Contributor

Looks like this happened? What remains, @josharian?

@josharian
Copy link
Contributor Author

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
@cuonglm
Copy link
Member

cuonglm commented Oct 5, 2023

We have one now after #61035

@cuonglm cuonglm closed this as completed Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants