[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

Re: [ID 20000118.004] DynaLoader doesn't dlclose XS code on interpreter



On Thu, Jan 20, 2000 at 01:14:42PM -0500, Ilya Zakharevich wrote:
> On Thu, Jan 20, 2000 at 11:16:00AM +0000, Tim Bunce wrote:
> > > > > Couldn't it be done in an END block inside DynaLoader?
> > > 
> > > Too early.  The only safe place (if any) should be
> > > after-the-end-of-global-destruction (assuming the list is kept in a C
> > > structure, thus is indestructible).
> > 
> > Good point, but I'm not so sure. Objects have been cleaned, via
> > sv_clean_objs(), before the END blocks are called.  (Umm, I don't see
> > any mention in the docs that objects will have been destroyed before
> > END blocks are called.)
> 
> Do not think so:
> 
> perl -wle 'sub a::new {bless [],"a"}; my $a="a"->new;END{print "<$a>"}'
> <a=ARRAY(0xe2064)>

Ah, I see I confused PL_exitlist with PL_endav.

Looks like DynaLoader::bootstrap just needs to call perl_atexit(...)
to register a callback to do the unloading after gobal destruction.
(For versions of perl that have perl_atexit()).

> > If destruct_level==0 then that's just about the last thing
> > perl_destruct() does before calling return.
> 
> destruct_level==0 has nothing to do with embedding anyway...

I didn't say it did (though I'd disagree with "nothing to do").

Tim.


Follow-Ups from:
Daniel Jacobowitz <drow@false.org>
References to:
Alan Burlison <Alan.Burlison@uk.sun.com>
Ilya Zakharevich <ilya@math.ohio-state.edu>
Tim Bunce <Tim.Bunce@ig.co.uk>
Ilya Zakharevich <ilya@math.ohio-state.edu>

[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]