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

Use standard lib's atomicint in go1.19+ #127

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

wwqgtxx
Copy link

@wwqgtxx wwqgtxx commented Feb 2, 2023

only the standard lib's sync/atomic has

// align64 may be added to structs that must be 64-bit aligned.
// This struct is recognized by a special case in the compiler
// and will not work if copied to any other package.
type align64 struct{}

which can ensure 64-bit aligned

the v1.10.0 version of uber-go/atomic when cause panic in mips with golang1.20

panic: unaligned 64-bit atomic operation

goroutine 136 [running]:
runtime/internal/atomic.panicUnaligned(...)
 runtime/internal/atomic/unaligned.go:8
runtime/internal/atomic.lockAndCheck(...)
 runtime/internal/atomic/atomic_mipsx.go:38
runtime/internal/atomic.Load64(0x2533bd4)
 runtime/internal/atomic/atomic_mipsx.go:94 +0xa8
go.uber.org/atomic.(*Int64).Load(...)
 go.uber.org/atomic@v1.10.0/int64.go:45

@CLAassistant
Copy link

CLAassistant commented Feb 2, 2023

CLA assistant check
All committers have signed the CLA.

@codecov
Copy link

codecov bot commented Feb 2, 2023

Codecov Report

Attention: Patch coverage is 0% with 43 lines in your changes are missing coverage. Please review.

Project coverage is 83.89%. Comparing base (78a3b8e) to head (0e55a85).
Report is 17 commits behind head on master.

Files Patch % Lines
internal/gen-atomicint-go119/main.go 0.00% 43 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##            master     #127       +/-   ##
============================================
- Coverage   100.00%   83.89%   -16.11%     
============================================
  Files           23       23               
  Lines          232      267       +35     
============================================
- Hits           232      224        -8     
- Misses           0       43       +43     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

internal/gen-atomicint/wrapper.tmpl Outdated Show resolved Hide resolved
internal/gen-atomicint-go119/wrapper.tmpl Outdated Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

3 participants