I have the following code, I'm wondering if theres...
# kotlin-native
z
I have the following code, I'm wondering if theres some way I can shorten it into just a one line function such as
val windowAttributes dpy.getWindowAttributes(window)
Copy code
val windowAttributes = nativeHeap.alloc<XWindowAttributes>() {
    XGetWindowAttributes(display.ptr, window, ptr)
}

// Do some stuff

nativeHeap.free(windowAttributes)