Skip to content

Commit d8e252b

Browse files
committed
LazyVals: expected value of flag takes only tree values, no need to use long.
1 parent 837d05f commit d8e252b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dotty/runtime/LazyVals.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ object LazyVals {
1111
final val BITS_PER_LAZY_VAL = 2
1212
final val LAZY_VAL_MASK = 3
1313

14-
@inline def CAS(t: Object, offset: Long, e: Long, v: Long, ord: Int) = {
1514
@inline def STATE(cur: Long, ord: Int) = (cur >> (ord * BITS_PER_LAZY_VAL)) & LAZY_VAL_MASK
15+
@inline def CAS(t: Object, offset: Long, e: Long, v: Int, ord: Int) = {
1616
val mask = ~(LAZY_VAL_MASK << ord * BITS_PER_LAZY_VAL)
1717
val n = (e & mask) | (v << (ord * BITS_PER_LAZY_VAL))
1818
compareAndSet(t, offset, e, n)

0 commit comments

Comments
 (0)