Code to see the reference count.
Here is code to show you but this example demonstrates what I was describing with Locals vs Globals it doesnt work the same way. Locals are on stack not reference counted Globals are.
There is really no useful way to track memory usage with reference count checking.
Unfortunatly with GC you really have to trust its working right. Biggest mistake with BMAX you can make is cyclical references or using handles.
Doug Stastny
Strict Type TestObject Field Blah : Int=66 End Type Function Count(o:object) local p:int ptr = int Ptr(byte ptr o)-1 const BBZERO:Int=-2147483648 Print p[0]-BBZERO end function Function Showlocal() Print "Local Reference Counting" local l:TestObject= New TestObject Count(l) local l2:TestObject=l Count(l) end function Function ShowGlobal() Print "Global Reference Counting" Global g:TestObject= New TestObject Count(g) Global g2:TestObject =g Count(g) end Function ShowLocal() Showglobal()
Here is code to show you but this example demonstrates what I was describing with Locals vs Globals it doesnt work the same way. Locals are on stack not reference counted Globals are.
There is really no useful way to track memory usage with reference count checking.
Unfortunatly with GC you really have to trust its working right. Biggest mistake with BMAX you can make is cyclical references or using handles.
Doug Stastny