Hello,
I try to have a memoryBlock containing pointers to other MemoryBlock. At the end of this sample code v1 equal v0 and each pointer of lut points to the same MemoryBlock. I get the same result with an array of Ptr. I tried to subclass MemoryBlock unsuccessfully. I’ve probably forgotten something and/or made a mistake somewhere, but where ?
Thanks for your lights
Const pHeight = 2160
Const sizeofPtr = 8
Const sizeofDouble = 8
Const sizeofSingle = 4
Var v0, v1 As Double
Var lut As New MemoryBlock(pHeight * sizeofPtr)
// If Not lut IsA MemoryBlock Then Return
For i As Integer = 0 To lut.Size - 1 Step sizeofPtr
lut.Ptr(i) = New MemoryBlock(pHeight * sizeofDouble)
Next
v0 = 3.14159265358979323846
lut.Ptr(0).DoubleValue(0) = v0
v1 = lut.Ptr(24).DoubleValue(0)
Break