|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
File::DosGlob keeps its own hash of arrays of file names. Each array
corresponds to one call site. When iteration finishes, it deletes
the array. But if iteration never finishes, and the op at the call
site is freed, the array remains. So eval "scalar<*>" will cause a
memory leak under the scope of ‘use File::DosGlob "glob"’.
We already have a mechanism for hooking the freeing of ops. So
File::DosGlob can use that.
This is similar to 11ddfebc6e which fixed up File::Glob, but that com-
mit mistakenly used a C static for storing the old hook, even though
PL_opfreehook is an interpreter variable, not a global. (The next
commit will fix that.)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use the address of the glob op instead.
This argument is going away, because it is undocumented, unused on
CPAN outside of the core, and may get in the way of allowing glob() to
be overridden properly.
Another reason is that File::DosGlob leaks memory, because a glob op
freed before iteration has finished will leave File::DosGlob still
holding on to the remainder of the list of files. The easiest way to
fix that will involve using an op address instead of a special index,
so there will be no reason to keep it.
|