uber-go / atomic

Wrapper types for sync/atomic which enforce atomic access
https://go.uber.org/atomic
MIT License
1.34k stars 100 forks source link

atomic.Uint8 atomic.Uint16 support not found #123

Open sureshbabuveggalam opened 1 year ago

sureshbabuveggalam commented 1 year ago

go data types uint8 and uint16 is not supported on "go.uber.org/atomic"

we required these datatypes supported on atomic for optimal memory and performance

abhinav commented 1 year ago

Hello, @sureshbabuveggalam. We can add atomic wrappers for uint8 and uint16 to the library, but because the minimum width supported by the underlying operations is 32 bits, these will end up being uint32 internally (e.g. atomic.Bool is a wrapper around int32) and undo the memory/performance use you were getting out of them.