FAQ

On Tue Jun 21 06:52:36 2005, nicholas wrote:
Should we replace the use of do_clean_named_objs() with a routine that
searches directly for any remaining objects, and directly reduces
their
reference counts?
Doing so would allow destructors to see freed SVs.

Instead, how’s this patch? It still needs tests and a commit message.

Watch:

$ perl -le' sub DESTROY{warn aaa}bless\$a[0]'
$ ./perl -le' sub DESTROY{warn aaa}bless\$a[0]'
aaa at -e line 1 during global destruction.
$ perl -le' { bless \my@x; *a=sub{@x}}sub DESTROY{warn aaa}'
$ ./perl -le' { bless \my@x; *a=sub{@x}}sub DESTROY{warn aaa}'
aaa at -e line 1 during global destruction.

Search Discussions

  • Dave Mitchell at Dec 14, 2010 at 11:57 pm

    On Sun, Dec 12, 2010 at 01:00:17PM -0800, Father Chrysostomos via RT wrote:
    On Tue Jun 21 06:52:36 2005, nicholas wrote:
    Should we replace the use of do_clean_named_objs() with a routine that
    searches directly for any remaining objects, and directly reduces
    their
    reference counts?
    Doing so would allow destructors to see freed SVs.

    Instead, how’s this patch? It still needs tests and a commit message.
    Looks plausible. I don't understand why you skip $STDOUT and $STDERR
    though.


    --
    A walk of a thousand miles begins with a single step...
    then continues for another 1,999,999 or so.
  • Father Chrysostomos via RT at Dec 19, 2010 at 10:31 pm

    On Tue Dec 14 15:57:54 2010, davem wrote:
    On Sun, Dec 12, 2010 at 01:00:17PM -0800, Father Chrysostomos via RT
    wrote:
    On Tue Jun 21 06:52:36 2005, nicholas wrote:
    Should we replace the use of do_clean_named_objs() with a routine that
    searches directly for any remaining objects, and directly reduces
    their
    reference counts?
    Doing so would allow destructors to see freed SVs.

    Instead, how’s this patch? It still needs tests and a commit message.
    Looks plausible. I don't understand why you skip $STDOUT and $STDERR
    though.
    do_clean_named_io_objs does the same thing. I thought it was so that
    destructors would be able to warn().
    (And I thought you wrote that code, too.)
  • Dave Mitchell at Dec 19, 2010 at 10:53 pm

    On Sun, Dec 19, 2010 at 02:31:48PM -0800, Father Chrysostomos via RT wrote:
    On Tue Dec 14 15:57:54 2010, davem wrote:
    On Sun, Dec 12, 2010 at 01:00:17PM -0800, Father Chrysostomos via RT
    wrote:
    On Tue Jun 21 06:52:36 2005, nicholas wrote:
    Should we replace the use of do_clean_named_objs() with a routine that
    searches directly for any remaining objects, and directly reduces
    their
    reference counts?
    Doing so would allow destructors to see freed SVs.

    Instead, how’s this patch? It still needs tests and a commit message.
    Looks plausible. I don't understand why you skip $STDOUT and $STDERR
    though.
    do_clean_named_io_objs does the same thing. I thought it was so that
    destructors would be able to warn().
    do_clean_named_io_objs() skips the STDOUT and STDERR filehandles; your
    codes skips the $STDOUT and $STDERR *scalars*.

    --
    Overhead, without any fuss, the stars were going out.
    -- Arthur C Clarke
  • Father Chrysostomos via RT at Dec 20, 2010 at 2:05 am

    On Sun Dec 19 14:54:14 2010, davem wrote:
    On Sun, Dec 19, 2010 at 02:31:48PM -0800, Father Chrysostomos via RT
    wrote:
    On Tue Dec 14 15:57:54 2010, davem wrote:
    On Sun, Dec 12, 2010 at 01:00:17PM -0800, Father Chrysostomos via
    RT
    wrote:
    On Tue Jun 21 06:52:36 2005, nicholas wrote:
    Should we replace the use of do_clean_named_objs() with a
    routine that
    searches directly for any remaining objects, and directly
    reduces
    their
    reference counts?
    Doing so would allow destructors to see freed SVs.

    Instead, how’s this patch? It still needs tests and a commit
    message.
    Looks plausible. I don't understand why you skip $STDOUT and
    $STDERR
    though.
    do_clean_named_io_objs does the same thing. I thought it was so that
    destructors would be able to warn().
    do_clean_named_io_objs() skips the STDOUT and STDERR filehandles; your
    codes skips the $STDOUT and $STDERR *scalars*.
    Oh dear. So it does. That was really, really stupid of me. :-)

    If I change the each instance of GvSV to GvIO in that statement, does
    the patch look good?
  • Dave Mitchell at Dec 20, 2010 at 10:30 am

    On Sun, Dec 19, 2010 at 06:05:19PM -0800, Father Chrysostomos via RT wrote:
    On Sun Dec 19 14:54:14 2010, davem wrote:
    do_clean_named_io_objs() skips the STDOUT and STDERR filehandles; your
    codes skips the $STDOUT and $STDERR *scalars*.
    Oh dear. So it does. That was really, really stupid of me. :-)

    If I change the each instance of GvSV to GvIO in that statement, does
    the patch look good?
    yes :-)

    --
    "Strange women lying in ponds distributing swords is no basis for a system
    of government. Supreme executive power derives from a mandate from the
    masses, not from some farcical aquatic ceremony."
    -- Dennis, "Monty Python and the Holy Grail"
  • Father Chrysostomos via RT at Jan 3, 2011 at 2:35 am

    On Mon Dec 20 02:30:37 2010, davem wrote:
    On Sun, Dec 19, 2010 at 06:05:19PM -0800, Father Chrysostomos via RT
    wrote:
    On Sun Dec 19 14:54:14 2010, davem wrote:
    do_clean_named_io_objs() skips the STDOUT and STDERR filehandles; your
    codes skips the $STDOUT and $STDERR *scalars*.
    Oh dear. So it does. That was really, really stupid of me. :-)

    If I change the each instance of GvSV to GvIO in that statement, does
    the patch look good?
    yes :-)
    Now tweaked and applied as 4155e4fe8.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupperl5-porters @
categoriesperl
postedDec 12, '10 at 9:00p
activeJan 3, '11 at 2:35a
posts7
users2
websiteperl.org

People

Translate

site design / logo © 2022 Grokbase