Allocating and obtaining a pointer of a struct is quite simple:
memScoped {
val str: StructType = alloc<StructType>()
val strPtr: CPointer<StructType> = str.ptr
}
But I'm struggling to allocate or get pointer of the Int
, UInt
, Long
, ULong
and other primitive data types.
Neither there is any extension to these types:
val intData = 5
intData.ptr // <-- no extension like that
Searched a lot, but there seems no documentation for this.
Any help is greatly appreciated :)