Hi!
A BlitzMax object's reference counter only counts Global and Field variables pointing to the object. Local variables aren't counted; when the GC gets called there's a loop running over the stack and counting the Locals.
Why is it done this way?
I guess it's for speed optimizing? or what is it for?
Or is there any other advantage because it's done like it is?
And as my second question: would you change this behaviour if we could have this features if all references were counted:
- multithreading (could really be possible in BMX!)
- Object Ptr not confusing the GC
- a method returning the refcount
A BlitzMax object's reference counter only counts Global and Field variables pointing to the object. Local variables aren't counted; when the GC gets called there's a loop running over the stack and counting the Locals.
Why is it done this way?
I guess it's for speed optimizing? or what is it for?
Or is there any other advantage because it's done like it is?
And as my second question: would you change this behaviour if we could have this features if all references were counted:
- multithreading (could really be possible in BMX!)
- Object Ptr not confusing the GC
- a method returning the refcount