Re: DConf 2013 Day 2 Talk 2: Shared Libraries in D by Martin Nowak

2013-05-29 Thread Diggory
With regard to the last point in the talk where Walter was 
suggesting not calling finalizers on objects whose code has been 
unloaded - would it not make more sense to simply call all the 
finalizers before unloading the library?


If the finalizer is not called you will potentially get resource 
leaks - although there's no guarantee currently that it will be 
called, isn't there the assumption that if it's not called the 
object still exists, even if it's not referenced anywhere? ie. 
you still have some guarantee that if you keep allocating objects 
and then unreferencing them that the number of unfinalized 
objects will never exceed some large but fixed value.


Re: DConf 2013 Day 2 Talk 2: Shared Libraries in D by Martin Nowak

2013-05-29 Thread Andrei Alexandrescu

On 5/29/13 10:05 PM, Meta wrote:

On Wednesday, 29 May 2013 at 14:44:38 UTC, Andrei Alexandrescu wrote:

http://www.reddit.com/r/programming/comments/1f9qq3/dconf_2013_day_2_talk_2_shared_libraries_in_d_by/


Apologies for the delay. Enjoy and vote up!


Andrei


The first couple talks were posted to Hacker News as well. Have you
stopped posting these there now?


Walter used to do that. I'll do it from now on.

https://news.ycombinator.com/item?id=5790649


Andrei


Re: DConf 2013 Day 2 Talk 2: Shared Libraries in D by Martin Nowak

2013-05-29 Thread Steven Schveighoffer

On Wed, 29 May 2013 22:12:54 -0400, Diggory digg...@googlemail.com wrote:

With regard to the last point in the talk where Walter was suggesting  
not calling finalizers on objects whose code has been unloaded - would  
it not make more sense to simply call all the finalizers before  
unloading the library?


In fact, I think in discussions after the talk (not recorded on video), we  
came to the same conclusion.  If you are unloading the library and have  
any pointers to classes from that library, that is a programming error.   
So it should be safe to destroy all known objects from that library.


-Steve


Re: DConf 2013 Day 2 Talk 2: Shared Libraries in D by Martin Nowak

2013-05-29 Thread Diggory
On Thursday, 30 May 2013 at 04:00:18 UTC, Steven Schveighoffer 
wrote:
On Wed, 29 May 2013 22:12:54 -0400, Diggory 
digg...@googlemail.com wrote:


With regard to the last point in the talk where Walter was 
suggesting not calling finalizers on objects whose code has 
been unloaded - would it not make more sense to simply call 
all the finalizers before unloading the library?


In fact, I think in discussions after the talk (not recorded on 
video), we came to the same conclusion.  If you are unloading 
the library and have any pointers to classes from that library, 
that is a programming error.  So it should be safe to destroy 
all known objects from that library.


-Steve


Ah, good to know :)