Commit Graph

4 Commits

Author SHA1 Message Date
Prashant Varanasi
e81582a97d Revert "Optimization for String.Store("")" (#32)
This optimization causes data races since we're changing the value field
without using atomics. E.g., a caller who has multiple goroutines
calling `Set("1")` and `Set("")` will race on the access to `s.v` since
one goroutine is trying to read it while the other sets it, neither
using atomic operations.

This reverts commit 16b44f14f0.
2017-11-14 08:16:11 -08:00
Bill Fumerola
16b44f14f0 Optimization for String.Store("") 2017-07-19 18:44:22 -04:00
Prashant Varanasi
d938bba906 Fix NewString disregarding the passed in string 2016-07-18 11:07:34 -07:00
Prashant Varanasi
fecc23564a Add String as a type-safe wrapper for atomic.Value 2016-07-17 12:43:23 -07:00