Skip to content

Commit

Permalink
Nowarn LazyVals
Browse files Browse the repository at this point in the history
  • Loading branch information
som-snytt committed Jan 28, 2025
1 parent a5d9e25 commit 6c2c5c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions library/src/scala/runtime/LazyVals.scala
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,13 @@ object LazyVals {
println(s"CAS($t, $offset, $e, $v, $ord)")
val mask = ~(LAZY_VAL_MASK << ord * BITS_PER_LAZY_VAL)
val n = (e & mask) | (v.toLong << (ord * BITS_PER_LAZY_VAL))
unsafe.compareAndSwapLong(t, offset, e, n)
unsafe.compareAndSwapLong(t, offset, e, n): @nowarn("cat=deprecation")
}

def objCAS(t: Object, offset: Long, exp: Object, n: Object): Boolean = {
if (debug)
println(s"objCAS($t, $exp, $n)")
unsafe.compareAndSwapObject(t, offset, exp, n)
unsafe.compareAndSwapObject(t, offset, exp, n): @nowarn("cat=deprecation")
}

def setFlag(t: Object, offset: Long, v: Int, ord: Int): Unit = {
Expand Down Expand Up @@ -147,7 +147,7 @@ object LazyVals {
def get(t: Object, off: Long): Long = {
if (debug)
println(s"get($t, $off)")
unsafe.getLongVolatile(t, off)
unsafe.getLongVolatile(t, off): @nowarn("cat=deprecation")
}

// kept for backward compatibility
Expand Down

0 comments on commit 6c2c5c5

Please sign in to comment.