Dan Sugalski <[EMAIL PROTECTED]> wrote: > At 8:07 AM +0100 12/10/04, Leopold Toetsch wrote:
>>* What is the intended usage of the action handler? >>* Specifically is this also ment for lazy DOD runs? >>* How is the relationship to the C<pop_pad> opcode? > The one thing that I figure *will* be done is that languages will > push a sweep or collect op in their scope cleanup in those cases > where the language knows that there's potentially easy temp cleanup > that needs doing, for example filehandles that should be closed when > the scope's exited if there are no outstanding references to them. That'll not be really easy: [ subroutine frame ] | | [ cleanup handler subroutine frame ] If the cleanup handler is a plain subroutine, the previous one, which should be cleaned, is alive. A lazy DOD will find the filehandle in the lexicals and likely in registers. It seems that we have to do kind of a tailcall to the cleanup handler and that we've to nullify PMC registers of the subroutine that called the cleanup handler. But that would make the cleanup handler useless for other tasks, like actively closing some resources. Doing this right needs a precise definition of the semantics of such a cleanup handler. leo