I'm trying to find the answers to this stuff myself, really I am, but...
Rem
Release removes the internal reference caused by creating an integer handle to a type.
End Rem
Type MyType
field bigmap[1024*1024]
End Type
a=new MyType
print MemAlloced()
Release a
GCCollect
print MemAlloced()
print a
b:MyType=new MyType
print MemAlloced()
Release b
GCCollect
Print MemAlloced()
This help file entry is very broken. MemAlloced() does not exist, and when replaced with GCMemAlloced() it still won't compile because B is not an integer and it errors on Release B.
I changed B to an int and then got rid of the release command and replaced it with b=0 to see what the compiler would do, and it did not free the memory. Not particularly surprising.
But it concerns me that one can that easily assign a type to an int, and it will not be freed, and no compile error will be generated, when one attempts to assign Null to it.
However, Strict to the rescue, right?
I also noticed when when looking to see how to use Strict, that SuperStrict doesn't have a description in the help file! Luckilly the BlitzWiki has a description.
Rem
Release removes the internal reference caused by creating an integer handle to a type.
End Rem
Type MyType
field bigmap[1024*1024]
End Type
a=new MyType
print MemAlloced()
Release a
GCCollect
print MemAlloced()
print a
b:MyType=new MyType
print MemAlloced()
Release b
GCCollect
Print MemAlloced()
This help file entry is very broken. MemAlloced() does not exist, and when replaced with GCMemAlloced() it still won't compile because B is not an integer and it errors on Release B.
I changed B to an int and then got rid of the release command and replaced it with b=0 to see what the compiler would do, and it did not free the memory. Not particularly surprising.
But it concerns me that one can that easily assign a type to an int, and it will not be freed, and no compile error will be generated, when one attempts to assign Null to it.
However, Strict to the rescue, right?
I also noticed when when looking to see how to use Strict, that SuperStrict doesn't have a description in the help file! Luckilly the BlitzWiki has a description.