Ali Shirvani
06/15/2023, 6:37 AMAli Shirvani
06/15/2023, 7:33 AMmyStringVal._encodeToByteArray_()._asUByteArray_()._refTo_(0)
Joel Denke
06/15/2023, 7:24 PMkatokay
06/20/2023, 6:05 PMactual fun put(dbi: Dbi, key: ByteArray, data: ByteArray, vararg options: PutOption) {
memScoped {
key.usePinned { keyP ->
val mdbKey = cValue<MDB_val>{
mv_data = keyP.addressOf(0)
mv_size = key.size.convert()
}
data.usePinned { dataP ->
val mdbData = cValue<MDB_val>{
mv_data = dataP.addressOf(0)
mv_size = data.size.convert()
}
println("Putting value")
check(mdb_put(ptr, dbi.dbi, mdbKey.ptr, mdbData.ptr, options.asIterable().toFlags()))
println("Put value")
}
}
}
Rizwan
06/22/2023, 11:45 AMnatario1
06/26/2023, 10:52 AMMarek Niedbach
06/27/2023, 9:44 AMcocoapods
plugin to use bundler when executing podInstall
task instead of simple pod install
execution? I’d like to have cocoapods installed via Bundler rather than preinstalled in the system.Edoardo Luppi
06/29/2023, 2:22 PMTrey
06/29/2023, 3:06 PMjQrgen
07/03/2023, 1:31 PMkevin.cianfarini
07/04/2023, 12:53 AMio_uring
bindings for Kotlin/Native. In doing so I need a worker thread that does a blocking operation to poll for completion events from the linux kernel. I need a mechanism to cancel this blocking operation, especially because runInterruptible
doesn't exist in any form on native. To do this I've had to jump through a few hoops. I grab the underlying thread ID via pthread_self
and then register a coroutine which invokes pthread_kill(SIGINT)
when that coroutine is cancelled.
Here's where things get weird.
Originally I set up a signal handler via the libc signal
API and invoked pthread_exit
. This crashed the Kotlin/Native runtime. While debugging I commented that out and everything just...worked? The blocking operation from io_uring
started magically returning EINTR
meaning it was interrupted successfully despite my registered signal handler intercepting and suppressing the signal.
Does that sound plausible? Here's the PR with a more thorough explanation if anyone is interested.Jeff Lockhart
07/04/2023, 3:30 AMAdam S
07/04/2023, 8:15 AMtypedef struct Ray {
Vector3 position; // Ray position (origin)
Vector3 direction; // Ray direction
} Ray;
Kotlin/Native generates a class with `val`s for the vector properties
expect class Ray(rawPtr: NativePtr) : CStructVar {
expect companion object : CStructVar.Type {}
expect val direction: Vector3 /* compiled code */
expect val position: Vector3 /* compiled code */
}
I’ve tried to create a new instance using cValue {}
val v = cValue<Ray> {
this.direction.x = 1f
this.direction.y = 2f
this.direction.z = 3f
this.position.x = 7f
this.position.y = 8f
this.position.z = 9f
}
but the direction and position vectors are still zeroJoel Denke
07/04/2023, 2:42 PMAdam S
07/06/2023, 11:00 AMvoid SetValue(const void *value, int type);
void main() {
float runTime = 0.0f;
while (true) {
runTime++
SetValue(&runTime, SET_VALUE_TYPE_RUNTIME);
float target[3] = { 1.0f, 2.0f, 3.0f };
SetValue(target, SET_VALUE_TYPE_TARGET);
}
}
It makes sense to use cValuesOf(1f, 2f, 3f)
for the target, since target
is an array. But should I use cValuesOf(runtime)
for a single number?Joel Denke
07/07/2023, 6:23 AMEdoardo Luppi
07/07/2023, 5:13 PMWyatt Kennedy
07/08/2023, 8:21 AMexcludeFilter
property removed from cinterop .def files at some point and the docs not updated? the IDE underlines it red and cinterop via gradle kotlin MPP compilations appears to ignore the property. Not sure how I can get cinterop to ignore a specific header by name, in this case wayland-client.h
Giorgi
07/08/2023, 3:41 PMld: framework not found XCTest
Giorgi
07/08/2023, 5:32 PMEdoardo Luppi
07/08/2023, 7:36 PMFindFirstChangeNotificationW
expects a DWORD
(UInt
) as last parameter, but the constants are all Int
Am I supposed to convert it with toUInt
or is it a problem with the type definitions?Wyatt Kennedy
07/09/2023, 5:53 AMGiorgi
07/09/2023, 11:04 AMlet center = NSWorkspace.shared.notificationCenter
init() {
center.addObserver(forName: NSWorkspace.didLaunchApplicationNotification,
object: nil, // always NSWorkspace
queue: OperationQueue.main) { (notification: Notification) in
if let app = notification.userInfo?[NSWorkspace.applicationUserInfoKey] as? NSRunningApplication {
if app.bundleIdentifier == "com.apple.Terminal" {
// User just launched the Terminal app; should we be worried?
print("blah")
}
}
}
}
Richard
07/09/2023, 1:26 PMRichard
07/09/2023, 4:06 PMRichard
07/09/2023, 4:08 PMRichard
07/09/2023, 4:16 PMRichard
07/09/2023, 4:28 PMWyatt Kennedy
07/11/2023, 5:04 AM<stdin>:1556:24: error: '__builtin_ia32_crc32qi' needs target feature sse4.2
return (unsigned int)(__builtin_ia32_crc32qi(p0, p1));
I know my cpu supports sse4.2 so I assume it's a config for clang that konan uses? Google is failing entirely here, does anyone know if this is some flag I can provide to konan/clang to indicate that this should be enabled during cinterop? The error does not indicate at all what code in the SDL headers that it's choking on.Wyatt Kennedy
07/11/2023, 9:11 PM