Re[2]: [Gc] A small patch for pthread_support

Ivan Maidanski ivmai at mail.ru
Wed Oct 22 02:18:17 PDT 2008


Hi!

> Thanks.
> 
> However, by normal C rules, those should be equivalent.  And it's often better not to explicitly initialize, since that tends to result in smaller executable files.  Since we are assuming that it is zero initialized, a comment to that effect would probably be a minor improvement.  But I don't see a reason to change the code.
> 
> Hans

You are right!
The only difference between "GC_thread GC_threads[THREAD_TABLE_SZ];" and "GC_thread GC_threads[THREAD_TABLE_SZ] = {0};" is possible executable size growth. For GCC-based compilers there is no difference at all.

Bye.

> 
> > -----Original Message-----
> > From: gc-bounces at napali.hpl.hp.com
> > [mailto:gc-bounces at napali.hpl.hp.com] On Behalf Of Ivan Maidanski
> > Sent: Monday, October 20, 2008 8:59 AM
> > To: gc at napali.hpl.hp.com
> > Subject: [Gc] A small patch for pthread_support
> >
> > Hi!
> >
> > GC_threads[] (hashtable roots) must be initially cleared
> > since some code (e.g., in GC_remove_all_threads_but_me(),
> > GC_mark_thread_local_free_lists(), GC_push_all_stacks()) does
> > chain traversing until NULL is reached.
> >
> > The patch is attached.
> >
> > Bye.
> >
> >
> 



More information about the Gc mailing list