Skip to content

Commit

Permalink
Merge pull request #3809 from typelevel/update/series/3.x/nscplugin-0…
Browse files Browse the repository at this point in the history
….4.15

Update nscplugin, sbt-scala-native, ... to 0.4.15 in series/3.x
  • Loading branch information
armanbilge authored Sep 18, 2023
2 parents 987d1f4 + c0f0307 commit a6c5b15
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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]()
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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))
}
Expand Down

0 comments on commit a6c5b15

Please sign in to comment.