Things are at last becoming clearer with how blitzmax handles types compared to b3d and bplus.
I've been having a play:
Under b3d and bplus there would in fact be 5000 new types being handled internally.
Now I understand why we need to throw these types into a linked-list. This is blitzmax's way of keeping hold of the types .. a bit like pegging em all up on a washing line.
I've been having a play:
Type testtype Field x:Byte End type Local a:testtype=New testtype FlushMem Print "mem allocated at start = "+MemAlloced() For Local d=1 To 5000 a=New testtype a.x=d FlushMem next Print "after 5000 NEW testtypes = "+MemAlloced() FlushMem Print "flushed mem = "+MemAlloced()Although the loop here seems to suggest there are 5000 NEW types being made, only one exists. The a:testtype is being overwritten time and time again. This took a while to sink in.
Under b3d and bplus there would in fact be 5000 new types being handled internally.
Now I understand why we need to throw these types into a linked-list. This is blitzmax's way of keeping hold of the types .. a bit like pegging em all up on a washing line.