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

[patch 0/3] rework sv.c body-inventory mechanics

Thread Next
Jim Cromie
January 27, 2010 17:30
[patch 0/3] rework sv.c body-inventory mechanics
Message ID:
these patches add a request-id to the body-parts allocation chain
ie to:
new_body, del_body macros,

In principle, this change will allow perl to track
each user of get_arena(), such that we can (later) reclaim it.

commit a7179733aa0f30dad474caf74d3536af9222b79b
Author: Jim Cromie <>
Date:   Wed Jan 27 11:52:36 2010 -0700

    change S_more_bodies to require NN reqid

    pull this mapping out of S_more_bodies, move it into callers:
       "void** const root = &PL_bodyroots[svtype]"

    This lets us use S_more_bodies to thread free bodies onto any root,
    not just those in the interpreter's PL_bodyroots[SVt_LAST]

    The ~16 sv_type consumers call S_more_bodies via macros, adjust them
    to pass &PL_bodyroot[svtype] as reqid.  This then transparently tracks
    all arenas, allocated to all svtypes, in all interpreters.

    The macro adjustments:
    - rename del_body --> del_body_private.  Its 2nd arg always was root,
      new-name states its usage better.  we keep old name too.
    - comment on global/private distinction, and shuffle new/del-body macros.
      del_*'s are simpler, and the visual organization is easier.

commit 96817878f41957d59a5a939eb2b9683dc3caaaad
Author: Jim Cromie <>
Date:   Wed Jan 27 11:52:35 2010 -0700

    change get_arena to require NN reqid param, add it to arena-desc

    this field will allow get-arena to remember the requestor of the
    arenas it serves out.  Later, release_arenas() will use the field
    to find and free arenas.

    get-arena() requires that caller pass a NN void* request-id so that
    arenas allocated by it can be tracked, then found later by release_arenas().
    The type promises no derefs, so pass +1 as NN default reqid,
    until plumbing is added.  Also cleanup obfuscated arg-names and types,
    add ARGS_ASSERT needed to enforce the NN, and add reqid to DEBUG_m call.

commit 750fcf1b9d3baea53dd25938aa3691395388d868
Author: Jim Cromie <>
Date:   Wed Jan 27 11:52:33 2010 -0700

    split arena_set mgmt fields out of struct arena_set

    move arena_set mgmt fields out of struct arena_set, into a new
    arena_mgmt struct, then add it as a member into struct arena_set.
    This isolates set-mgmt fields, simplifies ARENAS_PER_SET macro, and
    clarifies the intent.

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