> -----Original Message-----
> From: Gerald Richter [mailto:[EMAIL PROTECTED]]
> Sent: 19 January 2000 04:36
> To: Alan Burlison; [EMAIL PROTECTED]
> Subject: RE: Why does Apache do this braindamaged 
> dlclose/dlopen stuff?


> So I would agree to your last sentences that Dynloader is responsible for
unloading, because that's 
> the only module, which knows what it had loaded. 

Agreed. It's a relatively small change to DynaLoader, with great benefits
for embedded Perl.

>Also I am not so sure if  unloading all the libraries can be really
successfully done, because the Perl 
> XS libraries don't assume that they will ever unloaded (because they are
actualy only unloaded when the program exits). > > This may be the reason
for memory leaks Daniel metioned earlier, because the XS libraries don't
have a chance to
> free there resources (or not aware of that they actually should do so).

Yes and no. If XS libraries are written with OO-style wrappers (which, IMHO,
they always should be), then surely you can catch the unloading in a DESTROY
sub and use that to do the deallocation of resources? Perl can only manage
Perl resources, and extension resources should be the responsibility of the
the programmer.

Stephen.

Reply via email to