Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate all atomics automatically (#77)
`gen-valuewrapper` is specialized to generating type-safe atomic wrappers around `atomic.Value`. This limitation is unnecessary. Given functions to convert an exposed type to the underlying type (referred to as "packing" here) and back ("unpacking"), we can generate wrappers around any backing atomic type. This generalizes `valuewrapper` into an `atomicwrapper` implementing said functionality, and adding opt-in support for generating CAS, Swap, and JSON methods. With this, we can automatically generate bool, float64, and time.Duration atomic wrappers on top of Uint32, Uint64, and Int64 respectively, as well as their core functionality.
- Loading branch information