Skip Menu |

This queue is for tickets about the Devel-Size CPAN distribution.

Report information
The Basics
Id: 79789
Status: new
Priority: 0/
Queue: Devel-Size

People
Owner: nwc10+please+use+perlbug+for+perl+queries [...] colon.colondot.net
Requestors: TIMB [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: Controlling recursion - a proposal
[Ignoring the current interface for now] I'd like to propose this logic (in rough perlish pseudo-code) for deciding whether to chase a pointer to a refcounted thing: if (refcnt($thing) == 1) { return 1; # chase } if (++$pointer_refs_seen{address_of($thing)} == refcnt($thing)) { delete $pointer_refs_seen{address_of($thing)}; return 1; # chase } return 0; # don't chase So: * everything obviously owned directly will be followed without question. * everything else gets a 'visit count' incremented. * if the visit count has reached the ref count then we can chase the pointer.