Doubly-Linked
view release on metacpan or search on metacpan
lib/Doubly/Linked.xs view on Meta::CPAN
return _remove(self);
}
void _destroy (SV * self) {
dTHX;
if (_is_undef(self)) {
return;
}
/* Collect all nodes first, incrementing refcounts to keep them alive */
AV * nodes = newAV();
self = _goto_start(self);
HV * hash = (HV*)SvRV(self);
av_push(nodes, SvREFCNT_inc(self));
while (_defined(hash, "next", 4)) {
self = *hv_fetch(hash, "next", 4, 0);
av_push(nodes, SvREFCNT_inc(self));
hash = (HV*)SvRV(self);
}
( run in 0.623 second using v1.01-cache-2.11-cpan-39bf76dae61 )