Is there a deallocate bug in general?
A memory slot can be shared and used after deallocation, ( just nit picking).
Code: Select all
Type myData
Dim As Integer i
Dim As Short s
Dim As Byte b
End Type
dim as myData ptr z=allocate(sizeof(mydata))
print "Adress of z ";z
deallocate z
Dim As myData Ptr pd = New myData
print "Adress of pd "; pd
poke mydata,pd,type<mydata>(4,5,6)
print
print peek (mydata,z).i '<----- should be pd, not z deallocated
print peek (mydata,z).s ' "
print peek (mydata,z).b ' "
poke mydata,z,type<mydata>(40,50,60)
print peek (mydata,pd).i '<---- vice versa
print peek (mydata,pd).s
print peek (mydata,pd).b
delete pd
Sleep
Code: Select all
Adress of z 1710032
Adress of pd 1710032
4
5
6
40
50
60