Skip to content

Commit

Permalink
Merge pull request #5182 from dswarbrick/fix-unaligned-atomic
Browse files Browse the repository at this point in the history
Fix misaligned struct member used in atomic operation
  • Loading branch information
lucix-aws committed May 24, 2024
2 parents b3e1d80 + a49c26d commit 4861f8f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
### SDK Enhancements

### SDK Bugs
* Fix misaligned struct member used in atomic operation.
* This change fixes panics on 32-bit systems in services that use endpoint discovery.
6 changes: 3 additions & 3 deletions aws/crr/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ import (
// based on some key. The datastructure makes use of a read write
// mutex to enable asynchronous use.
type EndpointCache struct {
endpoints syncMap
endpointLimit int64
// size is used to count the number elements in the cache.
// The atomic package is used to ensure this size is accurate when
// using multiple goroutines.
size int64
size int64
endpoints syncMap
endpointLimit int64
}

// NewEndpointCache will return a newly initialized cache with a limit
Expand Down

0 comments on commit 4861f8f

Please sign in to comment.