Steven Schveighoffer <> changed:

           What    |Removed                     |Added
                 CC|                            |

--- Comment #7 from Steven Schveighoffer <> 2011-03-29 
09:47:53 PDT ---
It's unsafe.  The issue is that if you remove the element being iterated, it
goes back to the memory pool.

Here is the code that removes an element:

Note on line 402, the unused node is free'd using gc_free.

The only way I know to make it safe is letting the iteration routine remove the
current element at the right time .  Dcollections allows this.

The only way to solve this other than that is to keep a modification id, and
throw an error if the iteration discovers the array structure has been modified
during iteration.  A compiler error or warning will not help, because the
compiler cannot know whether a called function is going to modify the AA, or if
two AA references point to the same object.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to