diff --git a/core/native/src/main/scala/cats/effect/unsafe/KqueueSystem.scala b/core/native/src/main/scala/cats/effect/unsafe/KqueueSystem.scala index 9e79e101ab..ae748a8673 100644 --- a/core/native/src/main/scala/cats/effect/unsafe/KqueueSystem.scala +++ b/core/native/src/main/scala/cats/effect/unsafe/KqueueSystem.scala @@ -136,7 +136,8 @@ object KqueueSystem extends PollingSystem { final class Poller private[KqueueSystem] (kqfd: Int) { private[this] val changelistArray = new Array[Byte](sizeof[kevent64_s].toInt * MaxEvents) - @inline private[this] def changelist = changelistArray.at(0).asInstanceOf[Ptr[kevent64_s]] + @inline private[this] def changelist = + changelistArray.atUnsafe(0).asInstanceOf[Ptr[kevent64_s]] private[this] var changeCount = 0 private[this] val callbacks = new LongMap[Either[Throwable, Unit] => Unit]() diff --git a/project/plugins.sbt b/project/plugins.sbt index 46c20db612..5cfe507747 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -3,7 +3,7 @@ libraryDependencies += "org.scala-js" %% "scalajs-env-selenium" % "1.1.1" addSbtPlugin("org.typelevel" % "sbt-typelevel" % "0.5.3") addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.13.2") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.14") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.15") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.6") addSbtPlugin("pl.project13.scala" % "sbt-jcstress" % "0.2.0") addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.3.7") diff --git a/std/native/src/main/scala/cats/effect/std/SecureRandomCompanionPlatform.scala b/std/native/src/main/scala/cats/effect/std/SecureRandomCompanionPlatform.scala index 679b1c4b26..6589e53a4d 100644 --- a/std/native/src/main/scala/cats/effect/std/SecureRandomCompanionPlatform.scala +++ b/std/native/src/main/scala/cats/effect/std/SecureRandomCompanionPlatform.scala @@ -34,7 +34,7 @@ private[std] trait SecureRandomCompanionPlatform { var i = 0 while (i < len) { val n = Math.min(256, len - i) - if (sysrandom.getentropy(bytes.at(i), n.toULong) < 0) + if (sysrandom.getentropy(bytes.atUnsafe(i), n.toULong) < 0) throw new RuntimeException(fromCString(strerror(errno))) i += n } diff --git a/tests/native/src/test/scala/cats/effect/FileDescriptorPollerSpec.scala b/tests/native/src/test/scala/cats/effect/FileDescriptorPollerSpec.scala index e2027a4619..b06450cdcc 100644 --- a/tests/native/src/test/scala/cats/effect/FileDescriptorPollerSpec.scala +++ b/tests/native/src/test/scala/cats/effect/FileDescriptorPollerSpec.scala @@ -40,13 +40,15 @@ class FileDescriptorPollerSpec extends BaseSpec { ) { def read(buf: Array[Byte], offset: Int, length: Int): IO[Unit] = readHandle - .pollReadRec(()) { _ => IO(guard(unistd.read(readFd, buf.at(offset), length.toULong))) } + .pollReadRec(()) { _ => + IO(guard(unistd.read(readFd, buf.atUnsafe(offset), length.toULong))) + } .void def write(buf: Array[Byte], offset: Int, length: Int): IO[Unit] = writeHandle .pollWriteRec(()) { _ => - IO(guard(unistd.write(writeFd, buf.at(offset), length.toULong))) + IO(guard(unistd.write(writeFd, buf.atUnsafe(offset), length.toULong))) } .void @@ -121,7 +123,7 @@ class FileDescriptorPollerSpec extends BaseSpec { .surround { IO { // trigger all the pipes at once pipes.foreach { pipe => - unistd.write(pipe.writeFd, Array[Byte](42).at(0), 1.toULong) + unistd.write(pipe.writeFd, Array[Byte](42).atUnsafe(0), 1.toULong) } }.background.surround(latch.await.as(true)) }