ModularM
Modular3y ago
4 replies
mikegarts

Casting between DTypePointer[DType.uint8] and Pointer[UInt8] ?

Is it possible to cast between the two similar types, specifically to initialize a Pointer[UInt8] to point to the same memory addr as DTypePointer[DType.uint8]?

Here is an illustration:
    var ptrd = DTypePointer[DType.uint8].alloc(10)
    var ptrany : Pointer[UInt8]
    ptrany = ptrd # this won't work with any bitcast variant I tried...
Was this page helpful?