Nothing gets put into limbo.  The pointer is deleted/removed from the array 
thus reducing the reference count held by the object containing the value.  In 
the above example, the only pointer left is the one held by tSubArray until a 
copy of the pointer is placed in the array as the new key which raises the 
reference count back to two.  The reference count never goes to 0 so garbage 
collection would not touch it.

I’m sure I don’t have the terminology 100% in line with the source, but I think 
the idea is close.

Thanks,
Brian
On Jun 25, 2019, 9:40 PM -0400, Mark Wieder via use-livecode 
<use-livecode@lists.runrev.com>, wrote:
> On 6/25/19 4:31 PM, Brian Milby via use-livecode wrote:
> > Value object starts with a ref count of 1 in the array
> > The first put increases the ref count to 2
> > The delete takes it back to 1
> > The second put takes it back to 2
> > At the end of the handler it goes back to 1 since the local var goes away
>
> Mmmmm... no...
>
> With that logic, in my example the contents of tSubArray and limbo would
> be the same. Zero-based logic instead of one-based doesn't help either.
>
> --
> Mark Wieder
> ahsoftw...@gmail.com
>
> _______________________________________________
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
_______________________________________________
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to