aboutsummaryrefslogtreecommitdiff
path: root/tests/stm.go
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-01-23 08:44:49 -0300
committerEuAndreh <eu@euandre.org>2025-01-23 08:44:49 -0300
commit287b6584c5ed59bf1da376044bbbdafe0dd063f2 (patch)
treef477db4f716058f0ac3d9b721ad0ddda58c8a05d /tests/stm.go
parentSetup stub fuzz and benchmark test files (diff)
downloadstm-287b6584c5ed59bf1da376044bbbdafe0dd063f2.tar.gz
stm-287b6584c5ed59bf1da376044bbbdafe0dd063f2.tar.xz
src/stm.go: Rename AtomicGet => Deref and AtomicModify => Swap
Diffstat (limited to '')
-rw-r--r--tests/stm.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/stm.go b/tests/stm.go
index 816cdec..ab05d5c 100644
--- a/tests/stm.go
+++ b/tests/stm.go
@@ -83,10 +83,10 @@ func BenchmarkStdlibValueStore(b *testing.B) {
}
}
-func BenchmarkAtomicGet(b *testing.B) {
+func BenchmarkDeref(b *testing.B) {
x := NewVar(0)
for i := 0; i < b.N; i++ {
- AtomicGet(x)
+ Deref(x)
}
}
@@ -162,7 +162,7 @@ func BenchmarkReadVarSTM(b *testing.B) {
x := NewVar(0)
for i := 0; i < 1000; i++ {
go func() {
- AtomicGet(x)
+ Deref(x)
wg.Done()
}()
}
@@ -236,7 +236,7 @@ func Example() {
v = n.Get(tx)
}))
// or:
- v = AtomicGet(n)
+ v = Deref(n)
_ = v
// write to a variable