mikegarts
mikegarts
MModular
Created by mikegarts on 12/28/2023 in #questions
Documentation of .as_ptr and ._steal_ptr
Hi all, for some reason I can't find any documentation and usage examples of these methods (and the difference between them). Any hints where I can find it? Also - steal_ptr states than the caller is responsible to free the underlying memory. How one could do that? Thanks!
1 replies
MModular
Created by mikegarts on 11/27/2023 in #questions
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...
var ptrd = DTypePointer[DType.uint8].alloc(10)
var ptrany : Pointer[UInt8]
ptrany = ptrd # this won't work with any bitcast variant I tried...
5 replies