develooper Front page | perl.perl5.porters | Postings from January 2012

Re: [perl #47948] [documentation] Hash::Util::FieldHash

Thread Previous | Thread Next
Leon Timmermans
January 12, 2012 18:35
Re: [perl #47948] [documentation] Hash::Util::FieldHash
Message ID:
On Fri, Jan 13, 2012 at 3:08 AM, Father Chrysostomos via RT
<> wrote:
> My question is: Why is it unsafe at all to create or delete things from
> a hash that is being iterated?
> There have been at least three fixes to the deletion code since 5.14.
> Could it have anything to do with those?

One obvious problem would be reallocation. It can reorder the buckets,
thus causing the iteration to become unreliable. This is one reason
why C++ initially supported only treemaps: they provide reliable
iteration even in the face of map mutation.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About