How do I use `zeroValue` without a `memScoped` blo...
# kotlin-native
e
How do I use
zeroValue
without a
memScoped
block? I can't use
memScoped
as allocated memory should be freed by Windows itself later in time.
Well, I've done my own zeroing
Copy code
internal inline fun <reified T : CVariable> NativePlacement.allocZeroed(): T {
  val t = alloc<T>()
  memset(t.ptr, 0, sizeOf<T>().convert())
  return t
}
👍 1