-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
62d6e23
commit 1910862
Showing
4 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,7 @@ kotlin { | |
} | ||
} | ||
} | ||
linuxX64() | ||
|
||
sourceSets { | ||
all { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package ru.spbstu.wheels | ||
|
||
@PublishedApi | ||
internal actual fun Int.reverseBits(): Int { | ||
var i = this | ||
// HD, Figure 7-1 | ||
i = (i and 0x55555555) shl 1 or ((i ushr 1) and 0x55555555) | ||
i = (i and 0x33333333) shl 2 or ((i ushr 2) and 0x33333333) | ||
i = (i and 0x0f0f0f0f) shl 4 or ((i ushr 4) and 0x0f0f0f0f) | ||
i = (i shl 24) or ((i and 0xff00) shl 8) or | ||
((i ushr 8) and 0xff00) or (i ushr 24) | ||
return i | ||
} |
10 changes: 10 additions & 0 deletions
10
src/linuxX64Main/kotlin/ru/spbstu/wheels/NoStackThrowable.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package ru.spbstu.wheels | ||
|
||
// seems like there is no way of avoiding collecting stack trace on native now | ||
actual open class NoStackThrowable actual constructor(message: String?, cause: Throwable?) : Throwable() { | ||
actual constructor() : this(null, null) | ||
|
||
actual constructor(message: String) : this(message, null) | ||
|
||
actual constructor(cause: Throwable) : this(cause.message, cause) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package ru.spbstu.wheels | ||
|
||
import kotlin.native.identityHashCode | ||
|
||
actual fun identityHashCode(value: Any?): Int = value.identityHashCode() |